diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/TagController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/TagController.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index c5746734..5acc6852 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -86,10 +86,25 @@ class TagController extends Controller | |||
86 | { | 86 | { |
87 | $tags = $this->getDoctrine() | 87 | $tags = $this->getDoctrine() |
88 | ->getRepository('WallabagCoreBundle:Tag') | 88 | ->getRepository('WallabagCoreBundle:Tag') |
89 | ->findAllTagsWithEntries($this->getUser()->getId()); | 89 | ->findAllTags($this->getUser()->getId()); |
90 | |||
91 | $flatTags = []; | ||
92 | |||
93 | foreach ($tags as $key => $tag) { | ||
94 | $nbEntries = $this->getDoctrine() | ||
95 | ->getRepository('WallabagCoreBundle:Entry') | ||
96 | ->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag['id']); | ||
97 | |||
98 | $flatTags[] = [ | ||
99 | 'id' => $tag['id'], | ||
100 | 'label' => $tag['label'], | ||
101 | 'slug' => $tag['slug'], | ||
102 | 'nbEntries' => $nbEntries, | ||
103 | ]; | ||
104 | } | ||
90 | 105 | ||
91 | return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ | 106 | return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ |
92 | 'tags' => $tags, | 107 | 'tags' => $flatTags, |
93 | ]); | 108 | ]); |
94 | } | 109 | } |
95 | 110 | ||