Jak porównać pole daty / godziny z Doctrine2 z datą?

Chcę uzyskać przedmioty, które zostały stworzone dzisiaj przez QueryBuilder z Doctrine2. Chcę porównać pole createdAt (Datetime) z dzisiejszym parametrem (Date). Czy można to zrobić w jednym zapytaniu?

$qb = $this->createQueryBuilder('i');
$qb->innerJoin('i.type', 'it');
$qb->andWhere('it.name = :type');
$qb->andWhere('i.createdAt < :today');
// i.createdAt == datetime and :today parameter is a date

questionAnswers(6)

yourAnswerToTheQuestion