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;
|
$this->em = $em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUserRepository(UserRepository $repository)
|
||||||
|
{
|
||||||
|
$this->userRepo = $repository;
|
||||||
|
}
|
||||||
|
|
||||||
public function setApiClient(UserApi $userApi)
|
public function setApiClient(UserApi $userApi)
|
||||||
{
|
{
|
||||||
$this->api = $userApi;
|
$this->api = $userApi;
|
||||||
|
@ -116,7 +121,6 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$this->input = $input;
|
$this->input = $input;
|
||||||
$this->userRepo = $this->em->getRepository('SkobkinPointToolsBundle:User');
|
|
||||||
|
|
||||||
$this->logger->debug('UpdateSubscriptionsCommand started.');
|
$this->logger->debug('UpdateSubscriptionsCommand started.');
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ services:
|
||||||
calls:
|
calls:
|
||||||
- [setLogger, ['@logger']]
|
- [setLogger, ['@logger']]
|
||||||
- [setEntityManager, ['@doctrine.orm.entity_manager']]
|
- [setEntityManager, ['@doctrine.orm.entity_manager']]
|
||||||
|
- [setUserRepository, ['@app.point.user_repository']]
|
||||||
- [setApiClient, ['@app.point.api_user']]
|
- [setApiClient, ['@app.point.api_user']]
|
||||||
- [setApiDelay, ['%point_api_delay%']]
|
- [setApiDelay, ['%point_api_delay%']]
|
||||||
- [setSubscriptionManager, ['@app.point.subscriptions_manager']]
|
- [setSubscriptionManager, ['@app.point.subscriptions_manager']]
|
||||||
|
|
Loading…
Reference in a new issue