Создает менеджер сущностей доктрины

@param array $options

@return EntityManagerInterface

@throws Exception\InvalidArgumentException
@throws \Zend\ServiceManager\Exception\ServiceNotFoundException
@throws Exception\RuntimeException
342895
public function factory(array $options = [])
    {
        if (!array_key_exists(static::ENTITY_MANAGER_NAME, $options)) {
            $errMsg = sprintf('Option %s not found', static::ENTITY_MANAGER_NAME);
            throw new Exception\InvalidArgumentException($errMsg);
        }
        $emName = $options[static::ENTITY_MANAGER_NAME];

        return $this->getServiceLocator()->get($emName);
    }
301549
private function resolveOptions(array $options = [])
    {
        $resolver = new OptionsResolver();
        $this->configure($resolver);

        return $resolver->resolve($options);
    }
680092
protected function init($options)
    {
        if ($options instanceof Traversable) {
            $options = ArrayUtils::iteratorToArray($options);
        } elseif (!is_array($options)) {
            $errMsg = sprintf('%s  expects an array or Traversable config', __METHOD__);
            throw new Exception\InvalidArgumentException($errMsg);
        }

        if (!array_key_exists('serviceLocator', $options)) {
            $errMsg = 'Argument serviceLocator not found';
            throw new Exception\InvalidArgumentException($errMsg);
        }
        $this->setServiceLocator($options['serviceLocator']);

        if (!array_key_exists('moduleOptions', $options)) {
            $errMsg = 'Argument moduleOptions not found';
            throw new Exception\InvalidArgumentException($errMsg);
        }
        $this->setModuleOptions($options['moduleOptions']);
    }
749758
public function withOptions(array $options = [])
    {
        $options += [
            'readConcern' => $this->readConcern,
            'readPreference' => $this->readPreference,
            'typeMap' => $this->typeMap,
            'writeConcern' => $this->writeConcern,
        ];

        return new Database($this->manager, $this->databaseName, $options);
    }
622517
public function create(array $parameters = [])
    {
        $parameters = $this->optionResolver->resolve($parameters);

        $this->registerLoader();
        $this->setIgnoredNames();

        if (!$parameters['cache'] instanceof Cache) {
            throw new \InvalidArgumentException('"cache" has to be instance an instance of ' . Cache::class);
        }

        $reader = new CachedReader(
            new AnnotationReader(),
            $parameters['cache'],
            $parameters['debug']
        );

        if ($parameters['indexed'] === true) {
            return new IndexedReader($reader);
        }

        return $reader;
    }
243391
public function build($className , array $options = [] )
    {
        if (is_a($className, Configurable::class, true)) {
            $service = new $className($options);
            $this->propagate($service);
            return $service;
        }

        throw new ServiceNotFoundException($className);
    }
902315
public static function queryBuilderStatic(array $options = []) : \Object\Query\Builder {
		$class = get_called_class();
		$model = new $class();
		return $model->queryBuilder($options);
	}
799578
public static function createFromOptions(array $options)
    {
        Validate::notNull($options['Name'], 'options[Name]');

        $accessPolicy = new self($options['Name']);
        $accessPolicy->fromArray($options);

        return $accessPolicy;
    }
960001
public function setOptions(array $options): FieldTypeInterface
    {
        $this->validateOptions($options);
        $this->options = $this->parseOptions(array_merge(
            $this->getDefaultOptions(),
            $this->options,
            $options
        ));

        return $this;
    }
670908
public function load($id, $options = null)
	{
	    $id = $this->normalizeServiceId($id);
	    
	    if(!isset($this->services[$id])){
	        throw new Exception\ServiceNotFoundException(
                sprintf('Service ID "%s" does not exist', $id)
	        );
	    }
	    
        if($options == null){
            $options = $this->services[$id]['options'];
        }
        
        return $this->getServicePluginManager()->get($id, $options, true, true);
	}
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);
    }
229803
public function setOptions(array $options)
    {
        foreach ($options as $key => $value) {
            $this->options[$key] = $value;
            $value && $this->object->$key = $value;
        }

        return $this;
    }
481138
public function createUserMenu(array $options)
    {
        $menu = $this->factory->createItem('root');
        $menu->setLabel($this->token_storage->getToken()->getUser()->__toString());

        $event = new UserMenuCollectionEvent($menu);
        $this->dispatcher->dispatch(UserMenuCollectionEvent::NAME, $event);

        return $menu;
    }
1130702
protected function resolveOptions(array $options)
    {
        if ($this->resolver === null) {
            $this->resolver = new OptionsResolver();
            $this->configureOptions($this->resolver);
        }

        return $this->resolver->resolve($options);
    }
841287
public static function createFromResource(Resource $resource, array $options = [])
    {
        $entity = new self();

        $entity->applyResource($resource);

        return $entity;
    }
1355519
public function setOptions($options)
    {
        // Valid Options
        $validOptions = ['delete', 'update', 'constraint'];
        foreach ($options as $option => $value) {
            if (!in_array($option, $validOptions, true)) {
                throw new \RuntimeException(sprintf('"%s" is not a valid foreign key option.', $option));
            }

            // handle $options['delete'] as $options['update']
            if ('delete' === $option) {
                $this->setOnDelete($value);
            } elseif ('update' === $option) {
                $this->setOnUpdate($value);
            } else {
                $method = 'set' . ucfirst($option);
                $this->$method($value);
            }
        }

        return $this;
    }
201843
public function setOptions(AbstractOptions $options)
    {
        $optionsClass = Conversion::getOptionsFullQualifiedClassName($this);
        $inputOptionsClass = get_class($options);
        if ($inputOptionsClass !== $optionsClass) {
            throw new Exception\DomainException(sprintf(
                '"%s" expects that options set are an array or a valid "%s" instance; received "%s"',
                __METHOD__,
                $optionsClass,
                $inputOptionsClass
            ));
        }
        $this->options = $options;
        return $this;
    }