Create service

@param ServiceLocatorInterface $serviceLocator
@return mixed
978035
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var $env Environment */
        $env = $serviceLocator->getServiceLocator()->get('processing_environment');

        return new CollectDataTrigger(
            $env->getWorkflowEngine(),
            $serviceLocator->getServiceLocator()->get('prooph.link.processor_proxy.message_logger'),
            $serviceLocator->getServiceLocator()->get('prooph.link.system_config')
        );
    }
1299556
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $workflowServiceManager = $serviceLocator->get(Manager::class);

        /** @var Module $module */
        $module = $serviceLocator->get(Module::class);
        $metadataReaderManager = $module->getMetadataReaderManager();

        /** @var ModuleOptions $moduleOptions */
        $moduleOptions = $serviceLocator->get(ModuleOptions::class);

        $metadataReaderName = $moduleOptions->getMetadataReader();
        $metadataReaderOptions = $moduleOptions->getMetadataReaderOptions();
        $metadataReader = $metadataReaderManager->get($metadataReaderName, $metadataReaderOptions, false);

        $options = [
            'serviceManager' => $workflowServiceManager,
            'metadataReader' => $metadataReader
        ];

        return new ServiceTypeResolver($options);
    }
140485
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $options = new SmtpOptions(isset($config['mail']['transport']['options'])
            ? $config['mail']['transport']['options']
            : []
        );
        return (new Smtp())->setOptions($options);
    }
1328339
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var ServiceManager $serviceManager */
        $serviceManager = $serviceLocator->getServiceLocator();

        $controller = new ReportsController();

        /** @var EnvironmentRepositoryInterface $environmentRepository */
        $environmentRepository = $serviceManager->get('EnvironmentRepository');
        $controller->setEnvironmentRepository($environmentRepository);

        return $controller;
    }
943798
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $serviceLocator = $serviceLocator->getServiceLocator();
        $helper = new FlashMessenger();
        $controllerPluginManager = $serviceLocator->get('ControllerPluginManager');
        $flashMessenger = $controllerPluginManager->get('flashmessenger');
        $helper->setPluginFlashMessenger($flashMessenger);
        $config = $serviceLocator->get('Config');
        if (isset($config['view_helper_config']['flashmessenger'])) {
            $configHelper = $config['view_helper_config']['flashmessenger'];
            if (isset($configHelper['message_open_format'])) {
                $helper->setMessageOpenFormat($configHelper['message_open_format']);
            }

            if (isset($configHelper['message_separator_string'])) {
                $helper->setMessageSeparatorString($configHelper['message_separator_string']);
            }

            if (isset($configHelper['message_close_string'])) {
                $helper->setMessageCloseString($configHelper['message_close_string']);
            }

            if (!empty($configHelper['class_messages'])) {
                $helper->setClassMessages($configHelper['class_messages']);
            }
        }

        return $helper;
    }
70910
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $plugins = parent::createService($serviceLocator);
        $plugins->addPeeringServiceManager($serviceLocator);
        $plugins->setRetrieveFromPeeringManagerFirst(true);

        return $plugins;
    }
1253913
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var $env Environment */
        $env = $serviceLocator->get(Definition::SERVICE_ENVIRONMENT);

        return new WorkflowProcessor(
            $env->getNodeName(),
            $env->getEventStore(),
            $env->getProcessRepository(),
            $env->getWorkflowEngine(),
            $env->getProcessFactory()
        );
    }
411472
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $caller = false;
        $appSm = method_exists($serviceLocator, 'getServiceLocator') ? call_user_func([$serviceLocator, 'getServiceLocator']) : null;
        if ($appSm && $appSm->has('Application')) {
            /** @var Application $app */
            $app = $appSm->get('Application');
            $callerEvent = new CallerEvent();
            $app->getEventManager()->trigger(CallerEvent::EVENT_RESOLVE_CALLER, $callerEvent);
            if ($callerEvent->getCaller()) {
                $caller = $callerEvent->getCaller();
            }
        }

        $w = new BasicWorkflow($caller);

        return $w;
    }
53246
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($serviceLocator instanceof ServiceLocatorAwareInterface) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var \Zend\ServiceManager\ServiceLocatorInterface $viewHelperManager */
        $viewHelperManager = $serviceLocator->get('ViewHelperManager');
        /** @var \Zend\View\Helper\HeadLink $headLink */
        $headLink = $viewHelperManager->get('HeadLink');
        /** @var ServiceLocatorInterface $domainManager */
        $domainManager = $serviceLocator->get('MamuzBlog\DomainManager');
        /** @var \MamuzBlogFeed\Feed\Writer\BuilderInterface $builder */
        $builder = $domainManager->get('MamuzBlogFeed\Feed\WriterFactory');
        /** @var \MamuzBlogFeed\Options\ConfigProviderInterface $configProvider */
        $configProvider = $domainManager->get('MamuzBlogFeed\Options\ConfigProvider');

        return new HeadLinkAggregate($headLink, $builder, $configProvider);
    }
709992
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var $application Application */
        $application = $serviceLocator->get('application');

        // -------------------------------------------------------------------------------------

        $config = $serviceLocator->get('Config');
        $config = (isset($config['yima_authorize']) && is_array($config['yima_authorize']))
            ? $config['yima_authorize']
            : array();

        // add existance permissions to registry >>> {
        $permsConfig  = (isset($config['services'])) ? $config['services'] : array();
        $permsConfig  = new ServiceConfig($permsConfig);
        /** @var $permsManager \yimaAuthorize\Service\AuthServiceManager */
        $permsManager = new AuthServiceManager($permsConfig);

        return $permsManager;
        // <<< }
    }
275175
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $transportClass = 'Zend\\Mail\\Transport\\Sendmail';
        if(isset($config['contact']['transport_class']) && class_exists($config['contact']['transport_class'], true)){
            $transportClass = $config['contact']['transport_class'];
        }
        return new $transportClass($config);
    }
237972
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var \Doctrine\Common\Persistence\ObjectManager $entityManager */
        $entityManager = $serviceLocator->get('Doctrine\ORM\EntityManager');
        $repository = $entityManager->getRepository('MamuzContentManager\Entity\Page');

        $queryMapper = new QueryMapper($repository);
        $queryService = new Query($queryMapper);

        return $queryService;
    }
249250
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config             = $serviceLocator->get('config');
        $sessionOptions     = $serviceLocator->get(SessionOptions::class);
        $sessionConfig      = $config['uthando_session_manager']['config_options'] ?? [];
        /** @var SessionConfig $sessionConfigClass */
        $sessionConfigClass = $sessionOptions->getSessionConfigClass();
        $sessionConfigClass = new $sessionConfigClass() ;

        $sessionConfigClass->setOptions($sessionConfig);

        return $sessionConfigClass;
    }
1240289
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($appServiceLocator instanceof AbstractPluginManager) {
            $appServiceLocator->getServiceLocator();
        }

        /** @var ObjectManagerAutoDetectorInterface $objectManagerAutoDetector */
        $objectManagerAutoDetector = $appServiceLocator->get(ObjectManagerAutoDetectorInterface::class);

        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsManager */
        $moduleOptionsManager = $appServiceLocator->get(ModuleOptionsPluginManagerInterface::class);
        /** @var ModuleOptionsInterface $moduleOptions */
        $moduleOptions = $moduleOptionsManager->get(ModuleOptionsInterface::class);

        /** @var DoctrineOrmModuleConfigInterface $doctrineOrmModuleConfig */
        $doctrineOrmModuleConfig = $appServiceLocator->get(DoctrineOrmModuleConfigInterface::class);

        return new OrmEntityLocator($objectManagerAutoDetector, $moduleOptions, $doctrineOrmModuleConfig);
    }
920443
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($serviceLocator instanceof AbstractPluginManager) {
            $appServiceLocator = $serviceLocator->getServiceLocator();
        }


        /** @var EntryToObjectsService $entryToObjectsService */
        $entryToObjectsService = $appServiceLocator->get(EntryToObjectsService::class);

        $options = [
            'entryToObjectsService' => $entryToObjectsService
        ];

        return new EntryToObjectsControllerPlugin($options);
    }
771032
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($serviceLocator instanceof AbstractPluginManager) {
            $appServiceLocator = $serviceLocator->getServiceLocator();
        }



        $serializerManager = $appServiceLocator->get('SerializerAdapterManager');
        $moduleOptions = $appServiceLocator->get(ModuleOptions::class);
        $workflowService  = $appServiceLocator->get(Workflow::class);

        return new EntryToObjectsService(
            [
                'serializerManager' => $serializerManager,
                'moduleOptions' => $moduleOptions,
                'workflowService' => $workflowService
            ]
        );
    }
1022944
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $className = $this->getClassName();
        $keyName   = $this->getKeyName();
        $config    = $serviceLocator->get('config');
        $options   = isset($config[$keyName]) ? $config[$keyName] : [];
        return new $className($options);
    }