Used DQL for non-dynamic query in VisitRepository

This commit is contained in:
Alejandro Celaya 2018-12-19 14:36:03 +01:00
parent f8207994dc
commit 58dbee10c5

View file

@ -12,10 +12,10 @@ class VisitRepository extends EntityRepository implements VisitRepositoryInterfa
{ {
public function findUnlocatedVisits(): iterable public function findUnlocatedVisits(): iterable
{ {
$qb = $this->createQueryBuilder('v'); $dql = 'SELECT v FROM Shlinkio\Shlink\Core\Entity\Visit AS v WHERE v.visitLocation IS NULL';
$qb->where($qb->expr()->isNull('v.visitLocation')); $query = $this->getEntityManager()->createQuery($dql);
return $qb->getQuery()->iterate(); return $query->iterate();
} }
/** /**