Now injecting UserRepository into UpdateSubscriptionsCommand. UpdateSubscriptionsCommand still depends on EntityManager because of transactions.
This commit is contained in:
parent
ff38cbc278
commit
55b5aaa1a2
|
@ -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.');
|
||||
|
||||
|
|
|
@ -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']]
|
||||
|
|
Loading…
Reference in a new issue