If you want to call the SQL function in doctrine2, you can do this with Expression Func , but this will only work with DQL.
Here is an example that will tell you how to use the DATE_DIFF function, which is not included in the doctrine.
$qb = $repository->createQueryBuilder('l'); $qb->expr()->lte(new Doctrine\ORM\Query\Expr\Func('DATE_DIFF',array('lo.start_date', 'CURRENT_DATE()')),'0');
source share