Hi!
I just hit a brick wall when using a cast function in dql:
Code:
PHP Fatal error: Uncaught exception 'Doctrine\ORM\Query\QueryException' with message '[Syntax Error] line 0, col 125: Error: Expected known function, got 'date'' in /home/antoranz/Descargas/php/DoctrineORM-2.2.1/Doctrine/ORM/Query/QueryException.php:42
So.... what kind of voodoo will I have to use on doctrine to use a cast in DQL?
Just in case, what I need is get entities of which a datetime field matches today (in other words, match only the date).
I'm using something like this:
Code:
$em->createQuery("select u from Entity u where cast(u.datetimefield as date)=CURRENT_DATE");
Is there some other hack to implement it?