]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/TagRepository.php
add relation between entry and tag
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / TagRepository.php
index 903a99cda3804bddfa61751cdf611a3c6a209e75..0f362f79ebb0efdc37d4a9f2599e4100e24723e6 100644 (file)
@@ -6,5 +6,18 @@ use Doctrine\ORM\EntityRepository;
 
 class TagRepository extends EntityRepository
 {
+    public function findByEntries($entryId)
+    {
+        $qb = $this->createQueryBuilder('t')
+            ->select('t')
+            ->leftJoin('t.id', 'u')
+            ->where('e.isStarred = true')
+            ->andWhere('u.id =:userId')->setParameter('userId', $userId)
+            ->orderBy('e.createdAt', 'desc')
+            ->getQuery();
 
+        $paginator = new Paginator($qb);
+
+        return $paginator;
+    }
 }