mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
User existing service instead of getDoctrine
This commit is contained in:
parent
80784b782b
commit
25203e5081
8 changed files with 32 additions and 37 deletions
|
@ -32,15 +32,14 @@ class ExportCommand extends ContainerAwareCommand
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
try {
|
||||
$user = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($input->getArgument('username'));
|
||||
$user = $this->get('wallabag_user.user_repository')->findOneByUserName($input->getArgument('username'));
|
||||
} catch (NoResultException $e) {
|
||||
$output->writeln(sprintf('<error>User "%s" not found.</error>', $input->getArgument('username')));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$entries = $this->getDoctrine()
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
$entries = $this->get('wallabag_core.entry_repository')
|
||||
->getBuilderForAllByUser($user->getId())
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue