| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
| 38 | { |
||
| 39 | //@see \Nnx\Doctrine\Listener\ManagerRegistryListener |
||
| 40 | $results = $this->getEventManager()->trigger('get.doctrineManagerRegistry', $this, [], function ($managerRegistry) { |
||
| 41 | return $managerRegistry instanceof ManagerRegistry; |
||
| 42 | }); |
||
| 43 | |||
| 44 | $managerRegistry = $results->last(); |
||
| 45 | |||
| 46 | if (!$managerRegistry instanceof ManagerRegistry) { |
||
| 47 | $errMsg = 'ManagerRegistry not found'; |
||
| 48 | throw new Exception\RuntimeException($errMsg); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $managerRegistry; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |