@inheritdoc

@param ServiceLocatorInterface $serviceLocator
@param                         $name
@param                         $requestedName

@return boolean

@throws \Zend\ServiceManager\Exception\ServiceNotFoundException
557109
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (array_key_exists($requestedName, $this->prototype)) {
            return false !== $this->prototype[$requestedName];
        }

        $appServiceLocator = $serviceLocator;
        if ($serviceLocator instanceof AbstractPluginManager) {
            $appServiceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var OrmEntityLocatorInterface $ormEntityLocator */
        $ormEntityLocator = $appServiceLocator->get(OrmEntityLocatorInterface::class);

        $hasOrmEntity = $ormEntityLocator->has($requestedName);
        if (false === $hasOrmEntity) {
            $this->prototype[$requestedName] = false;
        }

        return $hasOrmEntity;
    }
870687
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (is_null($this->cachedFileGateway)) {
            $this->cachedFileGateway = new FileGateway(
                $serviceLocator->get('prooph.link.fileconnector.file_type_adapter_manager'),
                $serviceLocator->get('prooph.link.fileconnector.filename_renderer'),
                $serviceLocator->get('prooph.link.app.location_translator')
            );
        }

        return $this->cachedFileGateway;
    }
590125
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->getConfig($serviceLocator)[$requestedName];

        $httpClient = isset($config['http_client']) && $serviceLocator->has($config['http_client']) ?
        $serviceLocator->get($config['http_client']) : null;

        $baseRequest = isset($config['base_request']) && $serviceLocator->has($config['base_request']) ?
        $serviceLocator->get($config['base_request']) : null;

        $api = new HttpApi($httpClient, $baseRequest);

        // Array of int code valid
        if (isset($config['valid_status_code']) && is_array($config['valid_status_code'])) {
            $api->setValidStatusCodes($config['valid_status_code']);
        }
        // string json/xml
        if (isset($config['request_format'])) {
            $api->setRequestFormat($config['request_format']);
        }
        // Profiler
        if (isset($config['profiler']) && $serviceLocator->has($config['profiler'])) {
            $api->setProfiler($serviceLocator->get($config['profiler']));
        }

        return $api;
    }
977571
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        try {
            $identifiers = self::splitIntoIdentifiers($requestedName);
        } catch (ProcessException $e) {
            return false;
        }
        
        return $this->getDatatypesHandler($serviceLocator)->hasDataType($identifiers['mode'], $identifiers['type'], $identifiers['endpoint']);
    }
195945
public function canCreate(ContainerInterface $container, $requestedName)
    {
        $namespace = $this->getConfig($container)['namespace'];
        $ar = explode('_', $requestedName);

        return (count($ar) >= 2 && array_key_exists($ar[0], $namespace) && $ar[1] === 'model');
    }
98449
protected function getInputFilterByName(ServiceLocatorInterface $serviceLocator, $name)
    {
        if ($serviceLocator->has('InputFilterManager')) {
            $serviceLocator = $serviceLocator->get('InputFilterManager');
        }

        $obj = $serviceLocator->get($name);
        if (!$obj instanceof InputFilterInterface) {
            throw new Exception\RuntimeException(sprintf(
                'Instance of type %s is invalid; must implement %s',
                (is_object($obj) ? get_class($obj) : gettype($obj)),
                InputFilterInterface::class
            ));
        }
        return $obj;
    }
1123191
public function canCreate(ContainerInterface $container, $requestedName)
    {
        $config = $container->get("config");
        return (
            isset($config[static::KEY][$requestedName][static::KEY_CLASS]) &&
            is_a($config[static::KEY][$requestedName][static::KEY_CLASS], static::KEY_DEFAULT_CLASS, true)
        );
    }
1325260
public function registerService($name, $serviceId)
    {
        if (isset($this->serviceMap[$name])) {
            throw new \InvalidArgumentException(sprintf(
                '%s service "%s" is already registered',
                $this->serviceType, $name
            ));
        }

        $this->serviceMap[$name] = $serviceId;
        $this->services[$name] = null;
    }
851648
public static function factory(ContainerInterface $container, $requestedName, array $options=[])
    {
        $ob = new self($options);
        $ob->setContainer($container);
        return $ob;
    }
685407
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->getConfig($serviceLocator)[$requestedName];
        /** @var $mongodb \MongoDb */
        $mongodb = $serviceLocator->get($config['database']);
        return $mongodb->selectCollection($config['collection']);
    }
1343600
public function service($name)
    {
        if (!$this->services->offsetExists($name)) {
            throw new Exception(sprintf(Exception::SERVICE_NOT_EXISTS, $name));
        }

        return $this->services->offsetGet($name);
    }
642601
public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null)
    {
        return $this($container, $requestedName ?: FilterPluginManager::class, $this->creationOptions);
    }
772430
public function get($name)
    {
        if (!isset($this->services[$name])) {
            throw ServiceNotFoundException::fromName($name);
        }

        return $this->services[$name]($this);
    }
619972
static public function create(ServiceLocator $serviceLocator, $requestedClass, array $options = null)
    {
        if (class_exists($requestedClass)) {
            $reflection = new \ReflectionClass($requestedClass);

            $arguments = [];
            $constructor = $reflection->getConstructor();
            if ($constructor) {
                $constructorParams = $reflection->getConstructor()->getParameters();

                if (count($constructorParams) == 0) {
                    return new $requestedClass;
                } else {

                    foreach ($constructorParams as $param) {
                        $class = $param->getClass();

                        $argument = null;
                        if ($class) {
                            $argument = $serviceLocator->get($class->getName());

                            // The Service Locator itself is not in the SL, so checking for it explicitly
                            if ($class->getName() == ServiceLocator::class) {
                                $argument = $serviceLocator;
                            }
                        }

                        if ($argument == null && $serviceLocator->has($param->getName())) {
                            $argument = $serviceLocator->get($param->getName());
                        }

                        if (!$param->isOptional() && $argument == null) {
                            throw new \RuntimeException('Missing required argument "' . $param->getName() . '" for class "' . $requestedClass);
                        }

                        if ($param->isOptional() && $argument == null) {
                            $arguments[$param->getName()] = $param->getDefaultValue();
                        } else {
                            $arguments[$param->getName()] = $argument;
                        }
                    }
                }
            }

            $instance = $reflection->newInstanceArgs($arguments);
            return $instance;
        }

        throw new \RuntimeException('Cannot find class ' . $requestedClass);
    }
74038
public function get($name)
    {
        if (isset($this->service_managers[$name])) {
            return $this->service_managers[$name];
        } else {
            throw new ServiceManagerNotFoundException('No service manager has been registered as ' . $name);
        }
    }
208276
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if ($serviceLocator instanceof AbstractPluginManager && $serviceLocator->getServiceLocator()) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

        $config = $this->getConfig($serviceLocator)[$requestedName];

        //Create an object instance
        $class = $config['type'];
        if (!class_exists($class)) {
            throw new Exception\RuntimeException(sprintf(
                'ObjectAbstractServiceFactory expects the "type" to be a valid class; received "%s"',
                $class
            ));
        }
        $object = new $class;

        //Setup Hydrator
        $hydrator = null;
        if ($object instanceof HydratorAwareInterface
            && isset($config['hydrator'])
            && is_string($config['hydrator'])
            && !empty($config['hydrator'])
        ) {
            $object->setHydrator($this->getHydratorByName($serviceLocator, $config['hydrator']));
        }

        //Setup InputFilter
        if ($object instanceof InputFilterAwareInterface
            && isset($config['input_filter'])
            && is_string($config['input_filter'])
            && !empty($config['input_filter'])
        ) {
            $object->setInputFilter($this->getInputFilterByName($serviceLocator, $config['input_filter']));
        }

        //Setup ActiveRecord
        if ($object instanceof AbstractActiveRecord
            && isset($config['active_record_criteria'])
            && is_string($config['active_record_criteria'])
            && !empty($config['active_record_criteria'])
        ) {
            $object->setActiveRecordCriteriaPrototype($this->getActiveRecordCriteriaByName(
                $serviceLocator,
                $config['active_record_criteria']
            ));
        }

        return $object;
    }
427125
public function canCreate(ContainerInterface $container, $requestedName)
    {
        try {
            $config = $container->get("config");
        } catch (NotFoundExceptionInterface $e) {
            return false;
        } catch (ContainerExceptionInterface $e) {
            return false;
        }

        return (isset($config[static::KEY][$requestedName]));
    }