From 206bade58a279d7f2e34c2dbada10366b90d2d6b Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 1 Oct 2016 09:26:32 +0200 Subject: Add ability to reset some datas - annotations - tags - entries --- src/Wallabag/CoreBundle/Repository/TagRepository.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/Wallabag/CoreBundle/Repository') diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index e76878d4..69661b12 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -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. * -- cgit v1.2.3