X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FCommand%2FTagAllCommand.php;h=9843674e23980173e46f41b30f6d158c8c75fc00;hb=03ce43d466daf9d085f5b521b223cb8b351a1c0e;hp=2cf3f80842e5fc1bc27b14fcd336eaecc5cf5c69;hpb=a7f1921f7db312b5def3839393357f443dcbb52c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Command/TagAllCommand.php b/src/Wallabag/CoreBundle/Command/TagAllCommand.php index 2cf3f808..9843674e 100644 --- a/src/Wallabag/CoreBundle/Command/TagAllCommand.php +++ b/src/Wallabag/CoreBundle/Command/TagAllCommand.php @@ -28,16 +28,19 @@ class TagAllCommand extends ContainerAwareCommand try { $user = $this->getUser($input->getArgument('username')); } catch (NoResultException $e) { - $output->writeln(sprintf('User %s not found.', $input->getArgument('username'))); + $output->writeln(sprintf('User "%s" not found.', $input->getArgument('username'))); return 1; } $tagger = $this->getContainer()->get('wallabag_core.rule_based_tagger'); - $output->write(sprintf('Tagging entries for user « %s »... ', $user->getUserName())); + $output->write(sprintf('Tagging entries for user « %s »... ', $user->getUserName())); $entries = $tagger->tagAllForUser($user); + $output->writeln('Done.'); + $output->write(sprintf('Persist entries ... ', $user->getUserName())); + $em = $this->getDoctrine()->getManager(); foreach ($entries as $entry) { $em->persist($entry); @@ -56,7 +59,7 @@ class TagAllCommand extends ContainerAwareCommand */ private function getUser($username) { - return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username); + return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username); } private function getDoctrine()