I tried to have the current year in a query builder in a where condition with Doctrine 2 but impossible. With My SQL it's ok but with Doctrine nothing to do, it don't works. So could someone help me about this?
I tried (One by one):
->where('year = CURRENT_TIMESTAMP()')
->where('SUBSTRING(i.interventionDate),1,4) = CURRENT_DATE()')
->where('Year(i.interventionDate) = YEAR(CURDATE()')
->where($qb->expr()->gt('i.interventionDate', 'CURRENT_TIMESTAMP()'))
->where('SUBSTRING(i.interventionDate), 1,4) = CURRENT_TIMESTAMP()')
Thanks for advance