diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-03-31 17:28:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-31 17:28:54 +0200 |
commit | 19122cf66037f86375072ffa60b6a43b54f02f99 (patch) | |
tree | 62dc0812bc74e08f6fec9962bb62748e95e08aae /src/Wallabag/CoreBundle/Repository/TagRepository.php | |
parent | fa884b30ba0f8cb4231bd37fff23ef2f41ae6cfa (diff) | |
parent | 13a592a1288d7deb49211838368583c0109a5fbd (diff) | |
download | wallabag-19122cf66037f86375072ffa60b6a43b54f02f99.tar.gz wallabag-19122cf66037f86375072ffa60b6a43b54f02f99.tar.zst wallabag-19122cf66037f86375072ffa60b6a43b54f02f99.zip |
Merge pull request #3020 from wallabag/add-remove-archived-entries
Allow to remove all archived entries
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/TagRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/TagRepository.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 2182df25..6c63a6a2 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php | |||
@@ -76,4 +76,24 @@ class TagRepository extends EntityRepository | |||
76 | ->getQuery() | 76 | ->getQuery() |
77 | ->getSingleResult(); | 77 | ->getSingleResult(); |
78 | } | 78 | } |
79 | |||
80 | public function findForArchivedArticlesByUser($userId) | ||
81 | { | ||
82 | $ids = $this->createQueryBuilder('t') | ||
83 | ->select('t.id') | ||
84 | ->leftJoin('t.entries', 'e') | ||
85 | ->where('e.user = :userId')->setParameter('userId', $userId) | ||
86 | ->andWhere('e.isArchived = true') | ||
87 | ->groupBy('t.id') | ||
88 | ->orderBy('t.slug') | ||
89 | ->getQuery() | ||
90 | ->getArrayResult(); | ||
91 | |||
92 | $tags = []; | ||
93 | foreach ($ids as $id) { | ||
94 | $tags[] = $this->find($id); | ||
95 | } | ||
96 | |||
97 | return $tags; | ||
98 | } | ||
79 | } | 99 | } |