]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/ExportController.php
User existing service instead of getDoctrine
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / ExportController.php
index abc3336a412b06b4ddcf942184776a24021f90fe..b9e5a974acede4fc9d5f8cbcce36e3f1561b10c4 100644 (file)
@@ -57,16 +57,17 @@ class ExportController extends Controller
     {
         $method = ucfirst($category);
         $methodBuilder = 'getBuilderFor'.$method.'ByUser';
+        $epository = $this->get('wallabag_core.entry_repository');
 
         if ($category == 'tag_entries') {
-            $tag = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneBySlug($request->query->get('tag'));
+            $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag'));
 
-            $entries = $this->getDoctrine()
-                ->getRepository('WallabagCoreBundle:Entry')
-                ->findAllByTagId($this->getUser()->getId(), $tag->getId());
+            $entries = $epository->findAllByTagId(
+                $this->getUser()->getId(),
+                $tag->getId()
+            );
         } else {
-            $entries = $this->getDoctrine()
-                ->getRepository('WallabagCoreBundle:Entry')
+            $entries = $epository
                 ->$methodBuilder($this->getUser()->getId())
                 ->getQuery()
                 ->getResult();