Zend\Mvc\Service\ServiceListenerFactory::createService
Create the service listener service
Tries to get a service named ServiceListenerInterface from the service locator, otherwise creates a Zend\ModuleManager\Listener\ServiceListener service, passing it the service locator instance and the default service configuration, which can be overridden by modules. It looks for the 'service_listener_options' key in the application config and tries to add service manager as configured. The value of 'service_listener_options' must be a list (array) which contains the following keys: - service_manager: the name of the service manage to create as string - config_key: the name of the configuration key to search for as string - interface: the name of the interface that modules can implement as string - method: the name of the method that modules have to implement as string
Signature
public function createService(ServiceLocatorInterface
$serviceLocator )
Parameters
$serviceLocator
— Zend\ServiceManager\ServiceLocatorInterface
Returns
- ServiceListener
Errors/Exceptions
-
InvalidArgumentException
- For invalid configurations.
-
RuntimeException