- $max = $this->getEntityManager()
- ->createQuery('SELECT MAX(e.id) FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = :userId')
- ->setParameter('userId', $userId)
- ->getSingleScalarResult();
-
- $qb = $this->createQueryBuilder('e')
- ->where('e.user = :user_id')->setParameter('user_id', $userId);
+ $qb = $this->getQueryBuilderByUser($userId)
+ ->select('MIN(e.id)', 'MAX(e.id)');