Conditions | 3 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function __invoke(ProviderImportation $message) |
||
26 | { |
||
27 | $this->dm->clear(); |
||
28 | |||
29 | /** @var Provider $provider */ |
||
30 | $provider = $this->dm->getRepository('App:Provider')->find($message->getName()); |
||
31 | |||
32 | if (!$provider) { |
||
|
|||
33 | return; |
||
34 | } |
||
35 | |||
36 | try { |
||
37 | $rs = $this->packageImporter->import($provider); |
||
38 | $provider->setHasError(!$rs); |
||
39 | } catch (\Exception $e) { |
||
40 | $provider->setHasError(true); |
||
41 | $provider->setLogs($e->getMessage()); |
||
42 | } |
||
43 | |||
44 | $provider->setUpdateInProgress(false); |
||
45 | $this->dm->flush(); |
||
46 | |||
47 | $this->packageImporter->updateReplaceProviderSignature($provider); |
||
48 | $this->dm->flush(); |
||
49 | |||
50 | $this->publisher->publishProviderUpdate($provider); |
||
51 | |||
55 |