mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #6500] Allow internal functions to be overridden. #10008
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/6500
State: closed
Merged: Yes
Background
This came about because we're writing a driver for PrestoDB and wanted to implement windowing for the aggregate functions. This is fine for anything new, but we struggled when trying to add windowing support for count, avg, etc ...
Source: 6.15. Window Functions — Presto 0.178 Documentation
Solution
Obvious solution for us was to have the ability to override the internal aggregate functions. We moved the internal aggregate functions into the
$_NUMERIC_FUNCTIONSproperty so they can be overridden; They were handled as a special case before.The only part we weren't sure of was the
dctrnalias used: https://github.com/SamKnows/doctrine2/pull/1/files#diff-0c8825d1265a66bb8b20f3d99c276961If that doesn't matter and we can go with
sclr, then this is another path that can be removed.Thoughts?
PS. First big PR for the Doctrine internals 👍