+ $pagerAdapter = new DoctrineORMAdapter($qb);
+
+ return new Pagerfanta($pagerAdapter);
+ }
+
+ /**
+ * Fetch an entry with a tag. Only used for tests.
+ *
+ * @return Entry
+ */
+ public function findOneWithTags($userId)
+ {
+ $qb = $this->createQueryBuilder('e')
+ ->innerJoin('e.tags', 't')
+ ->innerJoin('e.user', 'u')
+ ->addSelect('t', 'u')
+ ->where('e.user=:userId')->setParameter('userId', $userId)
+ ;
+
+ return $qb->getQuery()->getResult();