X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FTagController.php;h=72822479794efa8ce426c4ca72c364834a9217f0;hb=25203e5081c8da21869db1d16610f83f888249b5;hp=9422bae43644b1796518d14ec5680661e4547fcd;hpb=80784b782becfaa297e6d9cbb0584e27739cffc8;p=github%2Fwallabag%2Fwallabag.git 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 */ public function showTagAction() { - $tags = $this->getDoctrine() - ->getRepository('WallabagCoreBundle:Tag') + $repository = $this->get('wallabag_core.entry_repository'); + $tags = $this->get('wallabag_core.tag_repository') ->findAllTags($this->getUser()->getId()); $flatTags = []; foreach ($tags as $tag) { - $nbEntries = $this->getDoctrine() - ->getRepository('WallabagCoreBundle:Entry') - ->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag->getId()); + $nbEntries = $repository->countAllEntriesByUserIdAndTagId( + $this->getUser()->getId(), + $tag->getId() + ); $flatTags[] = [ 'id' => $tag->getId(), @@ -119,9 +120,10 @@ class TagController extends Controller */ public function showEntriesForTagAction(Tag $tag, $page, Request $request) { - $entriesByTag = $this->getDoctrine() - ->getRepository('WallabagCoreBundle:Entry') - ->findAllByTagId($this->getUser()->getId(), $tag->getId()); + $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId( + $this->getUser()->getId(), + $tag->getId() + ); $pagerAdapter = new ArrayAdapter($entriesByTag);