/** * Get the service locator. * * @return \Zend\ServiceManager\ServiceLocatorInterface */ public function getServiceLocator() { if (get_class($this->serviceLocator) !== 'Zend\\ServiceManager\\ServiceManager') { return $this->serviceLocator->getServiceLocator(); } return $this->serviceLocator; }
protected function getConfig() { if (!$this->config) { $this->config = $this->serviceLocator->getServiceLocator()->get('VuFind\\Config')->get('config'); } return $this->config; }
/** * {@inheritDoc} */ public function createService(ServiceLocatorInterface $serviceLocator) { $validator = new VerifyEmailCode(); $validator->setEntityManager($serviceLocator->getServiceLocator()->get('doctrine.entitymanager.orm_default')); $validator->setAuthenticationService($serviceLocator->getServiceLocator()->get(AuthenticationService::class)); return $validator; }
public function setName($name) { parent::setName(strtolower($name) . '-settings'); $urlHelper = $this->formManager->getServiceLocator()->get('ViewHelperManager')->get('url'); $url = $urlHelper('lang/settings', array('module' => $name), true); $this->setAttribute('action', $url); }
/** * * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator * @return object */ public function createService(ServiceLocatorInterface $serviceLocator) { $options = $serviceLocator->getServiceLocator()->get('config')['sds']['identity']['forgot_credential_token_controller_options']; $options['service_locator'] = $serviceLocator->getServiceLocator()->get('doctrineExtensions.' . $options['manifest_name'] . '.servicemanager'); $instance = new ForgotCredentialTokenController(new ForgotCredentialTokenControllerOptions($options)); return $instance; }
public function setUri() { $uri = $this->_sm->getServiceLocator()->get('application')->getMvcEvent()->getRequest()->getUri(); $basePath = $currentHost = $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath(); $this->setBasePath($basePath); return $this; }
public function createService(ServiceLocatorInterface $serviceManager) { $request = $serviceManager->getServiceLocator()->get('Request'); $router = $serviceManager->getServiceLocator()->get('Router'); $routeMatch = $router->match($request); return new Languages($serviceManager->getServiceLocator()->get('T4webTranslate\\Languages\\Service\\Finder'), $serviceManager->getServiceLocator()->get('MvcTranslator'), $routeMatch); }
/** * Factory method. * * @param ServiceLocatorInterface $serviceLocator * @return PositionController */ public function createService(ServiceLocatorInterface $serviceLocator) { $ctr = new PositionController(); $ctr->setEntityManager($serviceLocator->getServiceLocator()->get('Doctrine\\ORM\\EntityManager')); $ctr->setSettingsService($serviceLocator->getServiceLocator()->get('Admin\\Service\\SettingsService')); return $ctr; }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { $authAdapter = $serviceLocator->getServiceLocator()->get('AuthAdapter'); $authService = $serviceLocator->getServiceLocator()->get('AuthService'); $authService->setAdapter($authAdapter); return new LoginController($authService); }
/** * * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator * @return object */ public function createService(ServiceLocatorInterface $serviceLocator) { $options = new Options($serviceLocator->getServiceLocator()->get('config')['sds']['authentication']['authenticated_identity_controller_options']); $options->setServiceLocator($serviceLocator->getServiceLocator()); $instance = new AuthenticatedIdentityController($options); return $instance; }
/** * Factory method. * * @param ServiceLocatorInterface $serviceLocator * @return YearController */ public function createService(ServiceLocatorInterface $serviceLocator) { $ctr = new YearController(); $ctr->setEntityManager($serviceLocator->getServiceLocator()->get('Doctrine\\ORM\\EntityManager')); $ctr->setYearService($serviceLocator->getServiceLocator()->get('YearService')); return $ctr; }
/** * * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator * @return object */ public function createService(ServiceLocatorInterface $serviceLocator) { $options = new Options($serviceLocator->getServiceLocator()->get('config')['zoop']['gateway']['authenticated_user_controller_options']); $options->setServiceLocator($serviceLocator->getServiceLocator()); $instance = new AuthenticatedUserController($options); return $instance; }
public function __invoke($controllerName, $actionName, $params = array()) { $controllerLoader = $this->serviceLocator->getServiceLocator()->get('ControllerLoader'); $controllerLoader->setInvokableClass($controllerName, $controllerName); $controller = $controllerLoader->get($controllerName); return $controller->{$actionName}($params); }
/** * Create a service for the specified name. * * @param ServiceLocatorInterface $serviceLocator Service locator * @param string $name Name of service * @param string $requestedName Unfiltered name of service * * @return object */ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) { $options = $serviceLocator->getServiceLocator()->get('VuFind\\SearchOptionsPluginManager')->get($requestedName); if ($name === 'solr' || $name == 'solrauthor') { // Clone the options instance in case caller modifies it: return new \Finna\Search\Solr\Params(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config'), $serviceLocator->getServiceLocator()->get('VuFind\\DateConverter')); } elseif ($name === 'primo') { // Clone the options instance in case caller modifies it: return new \Finna\Search\Primo\Params(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config')); } elseif ($name === 'metalib') { // Clone the options instance in case caller modifies it: return new \Finna\Search\MetaLib\Params(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config')); } elseif ($name === 'combined') { // Clone the options instance in case caller modifies it: return new \Finna\Search\Combined\Params(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config'), $serviceLocator->getServiceLocator()->get('VuFind\\DateConverter')); } elseif ($name === 'mixedlist') { // Clone the options instance in case caller modifies it: return new \Finna\Search\MixedList\Params(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config')); } elseif ($name === 'favorites') { // Clone the options instance in case caller modifies it: return new \Finna\Search\Favorites\Params(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config')); } elseif ($name === 'emptyset') { // Clone the options instance in case caller modifies it: return new \Finna\Search\EmptySet\Params(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config')); } return parent::createServiceWithName($serviceLocator, $name, $requestedName); }
/** * @param ServiceLocatorInterface $serviceLocator * @param $name * @param $requestedName * * @return mixed|object */ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) { if ($serviceLocator instanceof \Zend\Mvc\Controller\ControllerManager) { $this->serviceManager = $serviceLocator->getServiceLocator(); $this->controllerPluginManager = $serviceLocator; $this->formElementManager = $this->serviceManager->get('formElementManager'); $this->viewHelperManager = $this->serviceManager->get('viewHelperManager'); } elseif ($serviceLocator instanceof \Zend\View\HelperPluginManager) { $this->serviceManager = $serviceLocator->getServiceLocator(); $this->controllerPluginManager = $this->serviceManager->get('controllerPluginManager'); $this->formElementManager = $this->serviceManager->get('formElementManager'); $this->viewHelperManager = $serviceLocator; } elseif ($serviceLocator instanceof \Zend\Form\FormElementManager) { $this->serviceManager = $serviceLocator->getServiceLocator(); $this->controllerPluginManager = $this->serviceManager->get('controllerPluginManager'); $this->formElementManager = $serviceLocator; $this->viewHelperManager = $this->serviceManager->get('viewHelperManager'); } elseif ($serviceLocator instanceof \Zend\Mvc\Controller\PluginManager) { $this->serviceManager = $serviceLocator->getServiceLocator(); $this->controllerPluginManager = $serviceLocator; $this->formElementManager = $this->serviceManager->get('formElementManager'); $this->viewHelperManager = $this->serviceManager->get('viewHelperManager'); } else { $this->serviceManager = $serviceLocator; $this->controllerPluginManager = $this->serviceManager->get('controllerPluginManager'); $this->formElementManager = $this->serviceManager->get('formElementManager'); $this->viewHelperManager = $this->serviceManager->get('viewHelperManager'); } if (FALSE !== strstr($requestedName, 'Controller')) { $requestedName = $requestedName . 'Controller'; } return $this->buildGraph($requestedName); }
/** * Create a service for the specified name. * * @param ServiceLocatorInterface $serviceLocator Service locator * @param string $name Name of service * @param string $requestedName Unfiltered name of service * * @return object */ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) { $options = $serviceLocator->getServiceLocator()->get('VuFind\\SearchOptionsPluginManager')->get($requestedName); $class = $this->getClassName($name, $requestedName); // Clone the options instance in case caller modifies it: return new $class(clone $options, $serviceLocator->getServiceLocator()->get('VuFind\\Config')); }
/** * @return ServiceManager */ public function getServiceManager() { if (!$this->serviceManager) { $this->serviceManager = $this->serviceLocator->getServiceLocator(); } return $this->serviceManager; }
public function createService(ServiceLocatorInterface $sl) { $validator = $this->createValidator(); $validator->setValidatorService($sl->getServiceLocator()->get('LosLicense\\Service\\ValidatorService')); $validator->setServiceLocator($sl->getServiceLocator()); return $validator; }
/** * Creates the multiposting select box. */ public function createService(ServiceLocatorInterface $serviceLocator) { /* @var $serviceLocator \Zend\ServiceManager\AbstractPluginManager * @var $headscript \Zend\View\Helper\HeadScript * @var $channels \Jobs\Options\ProviderOptions */ $services = $serviceLocator->getServiceLocator(); $router = $services->get('Router'); $select = new MultipostingSelect(); $helpers = $services->get('ViewHelperManager'); $headscript = $helpers->get('headscript'); $basepath = $helpers->get('basepath'); $channels = $serviceLocator->getServiceLocator()->get('Jobs/Options/Provider'); $headscript->appendFile($basepath('Jobs/js/form.multiposting-select.js')); $options = array(); $groups = array(); foreach ($channels as $name => $channel) { /* @var $channel \Jobs\Options\ChannelOptions */ $category = $channel->getCategory(); if (!isset($groups[$category])) { $groups[$category] = array('label' => $category); } $link = $router->assemble($channel->getParams(), array('name' => $channel->getRoute())); $groups[$category]['options'][$channel->getKey()] = $channel->getLabel() . '|' . $channel->getHeadLine() . '|' . $channel->getDescription() . '|' . $channel->getLinkText() . '|' . $link . '|' . $channel->getPublishDuration() . '|' . $channel->getFormattedPrice() . '|' . $channel->getPrice(); } $select->setAttributes(array('data-autoinit' => 'false', 'multiple' => 'multiple')); $select->setValueOptions($groups); return $select; }
public function createService(ServiceLocatorInterface $serviceLocator) { $usermenu = new \Core\View\Helper\UserMenu(); $usermenu->setAuthService($serviceLocator->getServiceLocator()->get('ZfcRbac\\Service\\AuthorizationService')); $usermenu->setServiceManager($serviceLocator->getServiceLocator()); return $usermenu; }
public function createService(ServiceLocatorInterface $serviceLocator) { $console = $serviceLocator->getServiceLocator()->get('console'); $controllerService = $serviceLocator->getServiceLocator()->get('Scaffolding\\Service\\Controller\\CreateControllerService'); $actionService = $serviceLocator->getServiceLocator()->get('Scaffolding\\Service\\Controller\\CreateActionService'); return new ControllerController($console, $controllerService, $actionService); }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { /* @var $serviceLocator AbstractPluginManager */ $storage = $serviceLocator->getServiceLocator()->get('StrokerCache\\Storage\\CacheStorage'); $cacheService = $serviceLocator->getServiceLocator()->get('strokerCache\\Service\\CacheService'); return new RepositoryStorageInvalidator($cacheService, $storage); }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return ProcessManagerController */ public function createService(ServiceLocatorInterface $serviceLocator) { $con = new ProcessManagerController(); $con->setScriptLocation(ScriptLocation::fromPath(Definition::getScriptsDir())); $con->setLocationTranslator($serviceLocator->getServiceLocator()->get('prooph.link.app.location_translator')); $con->setWorkflowFinder($serviceLocator->getServiceLocator()->get(\Prooph\Link\ProcessManager\Projection\Workflow\WorkflowFinder::class)); return $con; }
public function createService(ServiceLocatorInterface $serviceLocator) { /** @var EntityManager $entityManager */ $entityManager = $serviceLocator->getServiceLocator()->get('doctrine.entitymanager.orm_default'); /** @var PasswordInterface $crypter */ $crypter = $serviceLocator->getServiceLocator()->get(PasswordInterface::class); return new Console($serviceLocator->getServiceLocator()->get('Config'), $entityManager, $crypter); }
public function createService(ServiceLocatorInterface $serviceLocator) { /** @var EntityManager $entityManager */ $entityManager = $serviceLocator->getServiceLocator()->get('doctrine.entitymanager.orm_default'); /** @var AuthenticationService $authenticationService */ $authenticationService = $serviceLocator->getServiceLocator()->get('Zend\\Authentication\\AuthenticationService'); return new Identity($entityManager, $authenticationService); }
public function createService(ServiceLocatorInterface $serviceLocator) { /** @var TwoFactorAuthenticationService $tfaService */ $tfaService = $serviceLocator->getServiceLocator()->get(TwoFactorAuthenticationService::class); /** @var VerifyCode $verifyCodeForm */ $verifyCodeForm = $serviceLocator->getServiceLocator()->get(VerifyCode::class); return new TwoFactorAuthentication($tfaService, $verifyCodeForm); }
public function createService(ServiceLocatorInterface $serviceLocator) { /** @var AuthenticationService $authenticationService */ $authenticationService = $serviceLocator->getServiceLocator()->get('Zend\\Authentication\\AuthenticationService'); /** @var Rbac $authorizationService */ $authorizationService = $serviceLocator->getServiceLocator()->get(Rbac::class); return new Access($authorizationService, $authenticationService); }
public function createService(ServiceLocatorInterface $serviceLocator) { /** @var Account $accountTaskService */ $accountTaskService = $serviceLocator->getServiceLocator()->get(Account::class); /** @var Group $groupTaskService */ $groupTaskService = $serviceLocator->getServiceLocator()->get(Group::class); return new Lookup($accountTaskService, $groupTaskService); }
public function createService(ServiceLocatorInterface $serviceLocator) { /** @var RendererInterface $view */ $view = $serviceLocator->getServiceLocator()->get('ViewRenderer'); /** @var AuthenticationService $authenticationService */ $authenticationService = $serviceLocator->getServiceLocator()->get(AuthenticationService::class); return new LoggedInAs($view, $authenticationService); }
public function createService(ServiceLocatorInterface $serviceLocator) { /** @var ContactTaskService $contactTaskService */ $contactTaskService = $serviceLocator->getServiceLocator()->get(ContactTaskService::class); /** @var FormInterface $contactForm */ $contactForm = $serviceLocator->getServiceLocator()->get('ZourceContactPersonForm'); return new Person($contactTaskService, $contactForm); }