1 | <?php |
||
2 | |||
3 | namespace Oliverde8\PhpEtlBundle\MessageHandler; |
||
4 | |||
5 | use Oliverde8\PhpEtlBundle\Message\EtlExecutionMessage; |
||
6 | use Oliverde8\PhpEtlBundle\Repository\EtlExecutionRepository; |
||
7 | use Oliverde8\PhpEtlBundle\Services\ChainProcessorsManager; |
||
8 | use Symfony\Component\Messenger\Handler\MessageHandlerInterface; |
||
9 | |||
10 | class EtlExecutionHandler implements MessageHandlerInterface |
||
11 | { |
||
12 | /** @var ChainProcessorsManager */ |
||
13 | protected $chainProcessorManager; |
||
14 | |||
15 | /** @var EtlExecutionRepository */ |
||
16 | protected $etlExecutionRepository; |
||
17 | |||
18 | /** |
||
19 | * EtlExecutionHandler constructor. |
||
20 | * @param ChainProcessorsManager $chainProcessorManager |
||
21 | * @param EtlExecutionRepository $etlExecutionRepository |
||
22 | */ |
||
23 | public function __construct(ChainProcessorsManager $chainProcessorManager, EtlExecutionRepository $etlExecutionRepository) |
||
24 | { |
||
25 | $this->chainProcessorManager = $chainProcessorManager; |
||
26 | $this->etlExecutionRepository = $etlExecutionRepository; |
||
27 | } |
||
28 | |||
29 | public function __invoke(EtlExecutionMessage $message) |
||
30 | { |
||
31 | $execution = $this->etlExecutionRepository->find($message->getId()); |
||
32 | $this->chainProcessorManager->executeFromEtlEntity($execution); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
33 | } |
||
34 | } |
||
35 |