diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 16d14d797..8645fb442 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -81,7 +81,7 @@ class TagController extends Controller { $tags = $this->getDoctrine() ->getRepository('WallabagCoreBundle:Tag') - ->findTags($this->getUser()->getId()); + ->findAllTags($this->getUser()->getId()); return $this->render( 'WallabagCoreBundle:Tag:tags.html.twig', diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index afeb985b3..abf915fe5 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -3,41 +3,9 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\EntityRepository; -use Pagerfanta\Adapter\DoctrineORMAdapter; -use Pagerfanta\Pagerfanta; class TagRepository extends EntityRepository { - /** - * Return only the QueryBuilder to retrieve all tags for a given user. - * - * @param int $userId - * - * @return QueryBuilder - */ - private function getQbForAllTags($userId) - { - return $this->createQueryBuilder('t') - ->leftJoin('t.entries', 'e') - ->where('e.user = :userId')->setParameter('userId', $userId); - } - - /** - * Find Tags and return a Pager. - * - * @param int $userId - * - * @return Pagerfanta - */ - public function findTags($userId) - { - $qb = $this->getQbForAllTags($userId); - - $pagerAdapter = new DoctrineORMAdapter($qb); - - return new Pagerfanta($pagerAdapter); - } - /** * Find Tags. * @@ -47,7 +15,9 @@ class TagRepository extends EntityRepository */ public function findAllTags($userId) { - return $this->getQbForAllTags($userId) + return $this->createQueryBuilder('t') + ->leftJoin('t.entries', 'e') + ->where('e.user = :userId')->setParameter('userId', $userId) ->getQuery() ->getResult(); } diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig index dfc617513..bb0ca9397 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig @@ -4,7 +4,7 @@ {% block content %}
-
{{ 'tag.list.number_on_the_page'|transchoice(tags.count) }}
+
{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}