|
@@ 122-129 (lines=8) @@
|
| 119 |
|
* creating a service. |
| 120 |
|
* @throws ContainerException if any other error occurs |
| 121 |
|
*/ |
| 122 |
|
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
| 123 |
|
{ |
| 124 |
|
$config = $this->getConfig($container, $requestedName); |
| 125 |
|
$events = $this->createEventManager($container, $config); |
| 126 |
|
|
| 127 |
|
$this->attachListeners($container, $events, $config['listeners']); |
| 128 |
|
return $events; |
| 129 |
|
} |
| 130 |
|
|
| 131 |
|
/** |
| 132 |
|
* Can the factory create an instance for the service? |
|
@@ 165-173 (lines=9) @@
|
| 162 |
|
* @return \Zend\EventManager\EventManagerInterface |
| 163 |
|
* @throws \UnexpectedValueException |
| 164 |
|
*/ |
| 165 |
|
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) |
| 166 |
|
{ |
| 167 |
|
$config = $this->getConfig($serviceLocator, $requestedName); |
| 168 |
|
$events = $this->createEventManager($serviceLocator, $config); |
| 169 |
|
|
| 170 |
|
$this->attachListeners($serviceLocator, $events, $config['listeners']); |
| 171 |
|
|
| 172 |
|
return $events; |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
/** |
| 176 |
|
* Gets configuration for an event manager. |