Search code examples
datetimesymfonydoctrine-ormdql

Is it posible to hydrate dates as DateTime in mixed queries in doctrine2?


I have a mixed query like this:

SELECT e, j.date_field FROM AcmeBundle:SomeEntity e JOIN e.joined_entity j

The query returns an array with the object and a string with the date, but I need dates hydrated as DateTime instances.

Is it posible to specify this in the query without building a custom hydrator?


Solution

  • It's not posible to do so without building a custom hydrator.

    This has been fixed in a recent Doctrine version as stated in this bug report.