diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-10 12:33:58 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-21 11:44:35 +0200 |
commit | 25203e5081c8da21869db1d16610f83f888249b5 (patch) | |
tree | 3e6f460b2e7d5e745113bbdfca3e2b2bc566a7d8 /src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php | |
parent | 80784b782becfaa297e6d9cbb0584e27739cffc8 (diff) | |
download | wallabag-25203e5081c8da21869db1d16610f83f888249b5.tar.gz wallabag-25203e5081c8da21869db1d16610f83f888249b5.tar.zst wallabag-25203e5081c8da21869db1d16610f83f888249b5.zip |
User existing service instead of getDoctrine
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php index 65f35d8e..89ae7998 100644 --- a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php +++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php | |||
@@ -46,7 +46,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand | |||
46 | return 1; | 46 | return 1; |
47 | } | 47 | } |
48 | } else { | 48 | } else { |
49 | $users = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findAll(); | 49 | $users = $this->get('wallabag_user.user_repository')->findAll(); |
50 | 50 | ||
51 | $output->writeln(sprintf('Cleaning through %d user accounts', count($users))); | 51 | $output->writeln(sprintf('Cleaning through %d user accounts', count($users))); |
52 | 52 | ||
@@ -66,7 +66,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand | |||
66 | private function cleanDuplicates(User $user) | 66 | private function cleanDuplicates(User $user) |
67 | { | 67 | { |
68 | $em = $this->getContainer()->get('doctrine.orm.entity_manager'); | 68 | $em = $this->getContainer()->get('doctrine.orm.entity_manager'); |
69 | $repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | 69 | $repo = $this->get('wallabag_core.entry_repository'); |
70 | 70 | ||
71 | $entries = $repo->getAllEntriesIdAndUrl($user->getId()); | 71 | $entries = $repo->getAllEntriesIdAndUrl($user->getId()); |
72 | 72 | ||
@@ -109,7 +109,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand | |||
109 | */ | 109 | */ |
110 | private function getUser($username) | 110 | private function getUser($username) |
111 | { | 111 | { |
112 | return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username); | 112 | return $this->get('wallabag_user.user_repository')->findOneByUserName($username); |
113 | } | 113 | } |
114 | 114 | ||
115 | private function getDoctrine() | 115 | private function getDoctrine() |