aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/ExportController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ExportController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index abc3336a..fda04cfb 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 8use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
9use Wallabag\CoreBundle\Entity\Entry; 9use Wallabag\CoreBundle\Entity\Entry;
10use Wallabag\CoreBundle\Entity\Tag;
11 10
12/** 11/**
13 * The try/catch can be removed once all formats will be implemented. 12 * The try/catch can be removed once all formats will be implemented.
@@ -57,16 +56,17 @@ class ExportController extends Controller
57 { 56 {
58 $method = ucfirst($category); 57 $method = ucfirst($category);
59 $methodBuilder = 'getBuilderFor'.$method.'ByUser'; 58 $methodBuilder = 'getBuilderFor'.$method.'ByUser';
59 $repository = $this->get('wallabag_core.entry_repository');
60 60
61 if ($category == 'tag_entries') { 61 if ($category == 'tag_entries') {
62 $tag = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneBySlug($request->query->get('tag')); 62 $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag'));
63 63
64 $entries = $this->getDoctrine() 64 $entries = $repository->findAllByTagId(
65 ->getRepository('WallabagCoreBundle:Entry') 65 $this->getUser()->getId(),
66 ->findAllByTagId($this->getUser()->getId(), $tag->getId()); 66 $tag->getId()
67 );
67 } else { 68 } else {
68 $entries = $this->getDoctrine() 69 $entries = $repository
69 ->getRepository('WallabagCoreBundle:Entry')
70 ->$methodBuilder($this->getUser()->getId()) 70 ->$methodBuilder($this->getUser()->getId())
71 ->getQuery() 71 ->getQuery()
72 ->getResult(); 72 ->getResult();