diff --git a/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php b/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php index 55d031a..1828dfd 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php @@ -71,6 +71,11 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand $this->em = $em; } + public function setUserRepository(UserRepository $repository) + { + $this->userRepo = $repository; + } + public function setApiClient(UserApi $userApi) { $this->api = $userApi; @@ -116,7 +121,6 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand protected function execute(InputInterface $input, OutputInterface $output) { $this->input = $input; - $this->userRepo = $this->em->getRepository('SkobkinPointToolsBundle:User'); $this->logger->debug('UpdateSubscriptionsCommand started.'); diff --git a/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml b/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml index 135f5fd..5ceb617 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml +++ b/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml @@ -52,6 +52,7 @@ services: calls: - [setLogger, ['@logger']] - [setEntityManager, ['@doctrine.orm.entity_manager']] + - [setUserRepository, ['@app.point.user_repository']] - [setApiClient, ['@app.point.api_user']] - [setApiDelay, ['%point_api_delay%']] - [setSubscriptionManager, ['@app.point.subscriptions_manager']]