diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-06-21 14:51:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-21 14:51:46 +0200 |
commit | 8c68acff2abe0573e287ad9ee4589668d1bb7ffa (patch) | |
tree | 0e67b949bde3bf8c441bfa77cbf9aa0a49326f72 /src/Wallabag/CoreBundle/Controller/TagController.php | |
parent | 80784b782becfaa297e6d9cbb0584e27739cffc8 (diff) | |
parent | bd40f1af88979cb5257206d178d26819e350a24c (diff) | |
download | wallabag-8c68acff2abe0573e287ad9ee4589668d1bb7ffa.tar.gz wallabag-8c68acff2abe0573e287ad9ee4589668d1bb7ffa.tar.zst wallabag-8c68acff2abe0573e287ad9ee4589668d1bb7ffa.zip |
Merge pull request #3207 from wallabag/tag-rss
Add RSS for tags
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/TagController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/TagController.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 9422bae4..a8b1eadd 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -84,16 +84,17 @@ class TagController extends Controller | |||
84 | */ | 84 | */ |
85 | public function showTagAction() | 85 | public function showTagAction() |
86 | { | 86 | { |
87 | $tags = $this->getDoctrine() | 87 | $repository = $this->get('wallabag_core.entry_repository'); |
88 | ->getRepository('WallabagCoreBundle:Tag') | 88 | $tags = $this->get('wallabag_core.tag_repository') |
89 | ->findAllTags($this->getUser()->getId()); | 89 | ->findAllTags($this->getUser()->getId()); |
90 | 90 | ||
91 | $flatTags = []; | 91 | $flatTags = []; |
92 | 92 | ||
93 | foreach ($tags as $tag) { | 93 | foreach ($tags as $tag) { |
94 | $nbEntries = $this->getDoctrine() | 94 | $nbEntries = $repository->countAllEntriesByUserIdAndTagId( |
95 | ->getRepository('WallabagCoreBundle:Entry') | 95 | $this->getUser()->getId(), |
96 | ->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag->getId()); | 96 | $tag->getId() |
97 | ); | ||
97 | 98 | ||
98 | $flatTags[] = [ | 99 | $flatTags[] = [ |
99 | 'id' => $tag->getId(), | 100 | 'id' => $tag->getId(), |
@@ -119,9 +120,10 @@ class TagController extends Controller | |||
119 | */ | 120 | */ |
120 | public function showEntriesForTagAction(Tag $tag, $page, Request $request) | 121 | public function showEntriesForTagAction(Tag $tag, $page, Request $request) |
121 | { | 122 | { |
122 | $entriesByTag = $this->getDoctrine() | 123 | $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId( |
123 | ->getRepository('WallabagCoreBundle:Entry') | 124 | $this->getUser()->getId(), |
124 | ->findAllByTagId($this->getUser()->getId(), $tag->getId()); | 125 | $tag->getId() |
126 | ); | ||
125 | 127 | ||
126 | $pagerAdapter = new ArrayAdapter($entriesByTag); | 128 | $pagerAdapter = new ArrayAdapter($entriesByTag); |
127 | 129 | ||
@@ -142,7 +144,7 @@ class TagController extends Controller | |||
142 | 'form' => null, | 144 | 'form' => null, |
143 | 'entries' => $entries, | 145 | 'entries' => $entries, |
144 | 'currentPage' => $page, | 146 | 'currentPage' => $page, |
145 | 'tag' => $tag->getSlug(), | 147 | 'tag' => $tag, |
146 | ]); | 148 | ]); |
147 | } | 149 | } |
148 | } | 150 | } |