aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command/ExportCommand.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-06-10 12:33:58 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-06-21 11:44:35 +0200
commit25203e5081c8da21869db1d16610f83f888249b5 (patch)
tree3e6f460b2e7d5e745113bbdfca3e2b2bc566a7d8 /src/Wallabag/CoreBundle/Command/ExportCommand.php
parent80784b782becfaa297e6d9cbb0584e27739cffc8 (diff)
downloadwallabag-25203e5081c8da21869db1d16610f83f888249b5.tar.gz
wallabag-25203e5081c8da21869db1d16610f83f888249b5.tar.zst
wallabag-25203e5081c8da21869db1d16610f83f888249b5.zip
User existing service instead of getDoctrine
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/ExportCommand.php')
-rw-r--r--src/Wallabag/CoreBundle/Command/ExportCommand.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Command/ExportCommand.php b/src/Wallabag/CoreBundle/Command/ExportCommand.php
index e3d3b399..e4977e11 100644
--- a/src/Wallabag/CoreBundle/Command/ExportCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ExportCommand.php
@@ -32,15 +32,14 @@ class ExportCommand extends ContainerAwareCommand
32 protected function execute(InputInterface $input, OutputInterface $output) 32 protected function execute(InputInterface $input, OutputInterface $output)
33 { 33 {
34 try { 34 try {
35 $user = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($input->getArgument('username')); 35 $user = $this->get('wallabag_user.user_repository')->findOneByUserName($input->getArgument('username'));
36 } catch (NoResultException $e) { 36 } catch (NoResultException $e) {
37 $output->writeln(sprintf('<error>User "%s" not found.</error>', $input->getArgument('username'))); 37 $output->writeln(sprintf('<error>User "%s" not found.</error>', $input->getArgument('username')));
38 38
39 return 1; 39 return 1;
40 } 40 }
41 41
42 $entries = $this->getDoctrine() 42 $entries = $this->get('wallabag_core.entry_repository')
43 ->getRepository('WallabagCoreBundle:Entry')
44 ->getBuilderForAllByUser($user->getId()) 43 ->getBuilderForAllByUser($user->getId())
45 ->getQuery() 44 ->getQuery()
46 ->getResult(); 45 ->getResult();