I'm trying to get the records that I have processed (DateTime) less than 2 days from the current date.
I'm starting from the following reasoning.
public function obtemSolicitacoesAntigasParaDeletar($executar = true){
$qb = $this->buscar(array(), false);
$qb->Where('sol.processadoEm < :data');
$params[':data'] = 'CURRENT_DATE() - INTERVAL 2 DAY';
$qb->setParameters($params);
return $executar === true ? $qb->getQuery()->getResult() : $qb;
}
But I'm noticing that it is not working accordingly, it returns me a record that does not satisfy this restriction.
In the SQL command this Query works, but in the doctrine it is not. Can anyone help me adjust this method?
Att. Felipe.