createQueryBuilder('v'); $qb->where('v.lastAccess < :date'); $qb->andWhere('v.totalVisit = 1'); $qb->setParameter('date', $date); return $qb->getQuery()->getResult(); } }