]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
add relation between user and tags, tests are broken
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index 005142fc568707a9b2e807f390dbf2cca8814fb2..a8085ac9cbeb01bdc4c7bb6331ef1b72f6380765 100644 (file)
@@ -118,4 +118,23 @@ class EntryRepository extends EntityRepository
             ->getQuery()
             ->getResult();
     }
+
+    /**
+     * Fetch an entry with a tag. Only used for tests.
+     *
+     * @return Entry
+     */
+    public function findOneWithTags($userId)
+    {
+        $qb = $this->createQueryBuilder('e')
+            ->innerJoin('e.tags', 't')
+            ->addSelect('t')
+            ->where('t.user=:userId')->setParameter('userId', 1);
+
+        return $qb->getQuery()->getOneOrNullResult();
+
+        return $qb
+            ->getQuery()
+            ->getOneOrNullResult();
+    }
 }