mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
fix test
This commit is contained in:
@@ -97,4 +97,9 @@ class WorkerRunningJobRepository extends EntityRepository
|
|||||||
$this->_em->rollback();
|
$this->_em->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getEntityManager()
|
||||||
|
{
|
||||||
|
return parent::getEntityManager();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,10 +38,6 @@ class RecordSubscriber implements EventSubscriberInterface
|
|||||||
* @var callable
|
* @var callable
|
||||||
*/
|
*/
|
||||||
private $appboxLocator;
|
private $appboxLocator;
|
||||||
/**
|
|
||||||
* @var WorkerRunningJobRepository
|
|
||||||
*/
|
|
||||||
private $repoWorker;
|
|
||||||
|
|
||||||
public function __construct(Application $app, callable $appboxLocator)
|
public function __construct(Application $app, callable $appboxLocator)
|
||||||
{
|
{
|
||||||
@@ -49,7 +45,6 @@ class RecordSubscriber implements EventSubscriberInterface
|
|||||||
$this->workerResolver = $app['alchemy_worker.type_based_worker_resolver'];
|
$this->workerResolver = $app['alchemy_worker.type_based_worker_resolver'];
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->appboxLocator = $appboxLocator;
|
$this->appboxLocator = $appboxLocator;
|
||||||
$this->repoWorker = $app['repo.worker-running-job'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onSubdefinitionCreate(SubdefinitionCreateEvent $event)
|
public function onSubdefinitionCreate(SubdefinitionCreateEvent $event)
|
||||||
@@ -104,8 +99,9 @@ class RecordSubscriber implements EventSubscriberInterface
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
$em = $this->repoWorker->getEntityManager();
|
$repoWorker = $this->getRepoWorker();
|
||||||
$workerRunningJob = $this->repoWorker->findOneBy([
|
$em = $repoWorker->getEntityManager();
|
||||||
|
$workerRunningJob = $repoWorker->findOneBy([
|
||||||
'databoxId' => $event->getRecord()->getDataboxId(),
|
'databoxId' => $event->getRecord()->getDataboxId(),
|
||||||
'recordId' => $event->getRecord()->getRecordId(),
|
'recordId' => $event->getRecord()->getRecordId(),
|
||||||
'work' => PhraseaTokens::MAKE_SUBDEF,
|
'work' => PhraseaTokens::MAKE_SUBDEF,
|
||||||
@@ -225,8 +221,9 @@ class RecordSubscriber implements EventSubscriberInterface
|
|||||||
|
|
||||||
$jeton = ($event->getSubdefName() == "document") ? PhraseaTokens::WRITE_META_DOC : PhraseaTokens::WRITE_META_SUBDEF;
|
$jeton = ($event->getSubdefName() == "document") ? PhraseaTokens::WRITE_META_DOC : PhraseaTokens::WRITE_META_SUBDEF;
|
||||||
|
|
||||||
$em = $this->repoWorker->getEntityManager();
|
$repoWorker = $this->getRepoWorker();
|
||||||
$workerRunningJob = $this->repoWorker->findOneBy([
|
$em = $repoWorker->getEntityManager();
|
||||||
|
$workerRunningJob = $repoWorker->findOneBy([
|
||||||
'databoxId' => $event->getRecord()->getDataboxId(),
|
'databoxId' => $event->getRecord()->getDataboxId(),
|
||||||
'recordId' => $event->getRecord()->getRecordId(),
|
'recordId' => $event->getRecord()->getRecordId(),
|
||||||
'work' => $jeton,
|
'work' => $jeton,
|
||||||
@@ -323,4 +320,12 @@ class RecordSubscriber implements EventSubscriberInterface
|
|||||||
|
|
||||||
return $callable();
|
return $callable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return WorkerRunningJobRepository
|
||||||
|
*/
|
||||||
|
private function getRepoWorker()
|
||||||
|
{
|
||||||
|
return $this->app['repo.worker-running-job'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user