private function getBuilderByUser($userId)
{
return $this->createQueryBuilder('e')
- ->leftJoin('e.user', 'u')
- ->andWhere('u.id = :userId')->setParameter('userId', $userId)
+ ->andWhere('e.user = :userId')->setParameter('userId', $userId)
->orderBy('e.createdAt', 'desc')
;
}
{
return $this
->getBuilderByUser($userId)
- ->leftJoin('e.tags', 't')
- ->groupBy('e.id')
- ->having('count(t.id) = 0');
+ ->andWhere('size(e.tags) = 0');
}
/**
$qb->orderBy('e.updatedAt', $order);
}
- $pagerAdapter = new DoctrineORMAdapter($qb);
+ $pagerAdapter = new DoctrineORMAdapter($qb, true, false);
return new Pagerfanta($pagerAdapter);
}