@param ServiceLocatorInterface $serviceLocator

@return DoctrineObjectHydratorLocator

@throws \Zend\ServiceManager\Exception\ServiceNotFoundException
505269
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($appServiceLocator instanceof AbstractPluginManager) {
            $appServiceLocator->getServiceLocator();
        }

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

        /** @var DoctrineObjectManagerInterface $objectManager */
        $objectManager = $appServiceLocator->get(DoctrineObjectManagerInterface::class);


        return new DoctrineObjectHydratorLocator($objectManagerAutoDetector, $objectManager);
    }
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);
    }
1215953
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');

        $client = new Client();
        if (!empty($config[$this->configKey])) {

            $clientOptions = $config[$this->configKey];

            if (isset($clientOptions['uri'])) {
                $client->setUri($clientOptions['uri']);
                unset($clientOptions['uri']);
            }

            if (isset($clientOptions['auth'])) {
                $auth = $clientOptions['auth'];
                $client->setAuth(
                    isset($auth['user'])     ? $auth['user']     : '',
                    isset($auth['password']) ? $auth['password'] : '',
                    isset($auth['type'])     ? $auth['type']     : $client::AUTH_BASIC
                );
                unset($clientOptions['auth']);
            }

            $client->setOptions($config[$this->configKey]);
        }

        return $client;
    }
1228148
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $resolver = new AggregateResolver();
        $resolver->attach($serviceLocator->get('GkSmartyTemplateMapResolver'));
        $resolver->attach($serviceLocator->get('GkSmartyTemplatePathStack'));

        return $resolver;
    }
1216068
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $this->getConfig($serviceLocator);

        if (!isset($config['cache'])) {
            return null;
        }

        $config = $config['cache'];
        /* @var $cache CacheProvider|Cache */
        $cache = null;
        $cacheFactory = $this->getCacheFactory($config);
        $cache = $cacheFactory->newInstance($config);

        if (isset($config['namespace'])) {
            $cache->setNamespace(trim($config['namespace']));
        }

        return $cache;
    }
872787
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var \Eye4web\Zf2Board\Options\ModuleOptions $options */
        $options = $serviceLocator->get('Eye4web\Zf2Board\Options\ModuleOptions');

        /** @var \Eye4web\Zf2Board\Mapper\PostMapperInterface $mapper */
        $mapper = $serviceLocator->get($options->getPostMapper());

        /** @var Form $postCreateForm */
        $postCreateForm = $serviceLocator->get('Eye4web\Zf2Board\Form\Post\CreateForm');

        /** @var Form $postEditForm */
        $postEditForm = $serviceLocator->get('Eye4web\Zf2Board\Form\Post\EditForm');

        $service = new PostService($mapper, $postCreateForm, $postEditForm);

        return $service;
    }
1332811
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsPluginManager */
        $moduleOptionsPluginManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);

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

        $metadataReaderCacheServiceName = $moduleOptions->getMetadataReaderCache();

        /** @var Cache $metadataReaderCache */
        $metadataReaderCache = $serviceLocator->get($metadataReaderCacheServiceName);

        $reader = new AnnotationReader();
        $reader = new CachedReader($reader, $metadataReaderCache);

        return new DiscriminatorEntryListener($reader);
    }
102783
public function createService(ServiceLocatorInterface $container)
    {
        // Retrieve the parent container when under zend-servicemanager v2
        if (method_exists($container, 'getServiceLocator')) {
            $container = $container->getServiceLocator() ?: $container;
        }

        return $this($container, DoctrineWriter::class);
    }
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);
    }
1257818
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('config');

        $locations = isset($config['locations'])? $config['locations'] : [];

        return new LocationTranslator($locations);
    }
735181
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new RevisionHydrator();

        /** @var GroupHydrator $groupHydrator */
        $groupHydrator = $serviceLocator->get('pmProxyGroupHydrator');
        $service->setGroupHydrator($groupHydrator);

        return $service;
    }
1117276
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /* @var $proxyFactory \ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory */
        $proxyFactory = $serviceLocator->get('OcraServiceManager\\ServiceManager\\AccessInterceptorProxyFactory');
        /* @var $locatorInterceptors \Closure[] */
        $locatorInterceptors = $serviceLocator->get('OcraServiceManager\\ServiceManager\\AccessInterceptors');

        return new ServiceLocatorDelegatorFactory($proxyFactory, $locatorInterceptors);
    }
589803
public function createService(ServiceLocatorInterface $container)
    {
        // Retrieve the parent container when under zend-servicemanager v2
        if (method_exists($container, 'getServiceLocator')) {
            $container = $container->getServiceLocator() ?: $container;
        }

        return $this($container, ErrorReference::class);
    }
1019435
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($this->container !== null) {
            return $this->container;
        }

        $builder = new ContainerBuilder();
        $config = $this->getConfig($serviceLocator);
        $configFile = $this->getDefinitionsFilePath($config);
        $builder->addDefinitions($configFile);

        $useAnnotations = $this->shouldUseAnnotations($config);
        $builder->useAnnotations($useAnnotations);

        $acclimator = new ContainerAcclimator();
        $zfContainer = $acclimator->acclimate($serviceLocator);
        $builder->wrapContainer($zfContainer);

        /**
         * @var $cache Cache
         */
        $cache = $this->getCache($serviceLocator, $config);

        if ($cache) {
            $builder->setDefinitionCache($cache);
        }

        $this->container = $builder->build();

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

        /** @var DoctrineObjectManager $doctrineObjectManager */
        $doctrineObjectManager = $appServiceLocator->get(DoctrineObjectManager::class);

        /** @var EntityMapCacheInterface $entityMapCache */
        $entityMapCache = $appServiceLocator->get(EntityMapCacheInterface::class);

        return new EntityMapBuilderController($doctrineObjectManager, $entityMapCache);
    }
1120614
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsManager */
        $moduleOptionsManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);

        /** @var DoctrineObjectManagerInterface $doctrineObjectManager */
        $doctrineObjectManager = $serviceLocator->get(DoctrineObjectManagerInterface::class);

        return new ObjectManagerAutoDetector($moduleOptionsManager, $doctrineObjectManager);
    }
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);
    }