I have a DQL query which contains a lot of DATETIME
fields from multiple entities and uses aggregation functions as well.
The fields of entity classes themselves have the proper annotations like so:
@Column(name="transaction_date", type="datetime", nullable=false)
Is it possible to get them as DateTime
objects instead of strings?
Just take a look at the following DQL query for instance:
SELECT MIN(e.orderDate), MAX(e2.transactionDate)
FROM Entry1 e
INNER JOIN e.joinedEntry2 e2
WHERE e.order = ?1
When using $query->getResult()
, I would get an array with two strings (instead with two DateTime
instances) regardless of the hydration mode I am using.