diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/TagController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/TagController.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 9422bae4..72822479 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 | ||