createService(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) : \Zend\ModuleManager\Listener\ServiceListener
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
\Zend\ServiceManager\ServiceLocatorInterface
\Zend\Mvc\Exception\InvalidArgumentException |
For invalid configurations. |
---|---|
\Zend\Mvc\Exception\RuntimeException |
$defaultServiceConfig : array
MISSING_KEY_ERROR : string
VALUE_TYPE_ERROR : string