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
{
$qb = $this->createQueryBuilder('v');
$qb->where($qb->expr()->isNull('v.visitLocation'));
$dql = 'SELECT v FROM Shlinkio\Shlink\Core\Entity\Visit AS v WHERE v.visitLocation IS NULL';
$query = $this->getEntityManager()->createQuery($dql);
return $qb->getQuery()->iterate();
return $query->iterate();
}
/**