*/ class AuthorizeAwareServiceInitializer implements InitializerInterface { /** * {@inheritDoc} */ public function initialize($instance, ServiceLocatorInterface $serviceLocator) { if ( ! $instance instanceof AuthorizeAwareInterface) { return; } /* @var $authorize \BjyAuthorize\Service\Authorize */ $authorize = $serviceLocator->get('BjyAuthorize\Service\Authorize'); $instance->setAuthorizeService($authorize); } }