I have a Symfony2 application with a table that contains a date field, whose type is DateTime.
I need to get all the entities where that field value is now.
If I uses the following code, I get 0 results because Doctrine is comparing the DateTime object.
$now = new \DateTime();
data = $entityRepository->findByDate($now);
I need to only compare year, month, and day, not hours.
How can I achieve this?