mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3573: DateTime objects casted to string when used in aggregate functions in query results #4394
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?
Originally created by @doctrinebot on GitHub (Feb 18, 2015).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user fivejeez:
Similar to DDC-657: [http://www.doctrine-project.org/jira/browse/DDC-657]
DateTime objects are converted to strings when selecting them through an aggregate function.
Example:
The result contains the date/times as strings not DateTime objects as expected. This affects the query builder. I assume it also affects DQL queries.
@agarb7 commented on GitHub (Apr 11, 2018):
Is it bug or behavior by design?
@Ocramius commented on GitHub (Apr 11, 2018):
max(u.entryDate) as updateDatemeansapply function MAX() to updateDate, which may really produce anything.Function return values are never really converted to anything, as we can't predict any type transformations happening in there.
@Ocramius commented on GitHub (Apr 11, 2018):
Closing as
can't fix