]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/TagRepository.php
Add ability to reset some datas
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / TagRepository.php
index e76878d49d6e7cc5bb06c0f2a1d8227ef2bec4bc..69661b128374a2a905e7b7b77a1f4b3fb39a71b3 100644 (file)
@@ -52,6 +52,23 @@ class TagRepository extends EntityRepository
             ->getArrayResult();
     }
 
+    /**
+     * Find all tags.
+     *
+     * @param int $userId
+     *
+     * @return array
+     */
+    public function findAllTags($userId)
+    {
+        return $this->createQueryBuilder('t')
+            ->select('t')
+            ->leftJoin('t.entries', 'e')
+            ->where('e.user = :userId')->setParameter('userId', $userId)
+            ->getQuery()
+            ->getResult();
+    }
+
     /**
      * Used only in test case to get a tag for our entry.
      *