Возвращает настройки менеджера по его имени

@param string $managerName

@return ManagerOptions

@throws Exception\InvalidManagerNameException
15480
public function getManagerOptions($managerName)
    {
        if (!array_key_exists($managerName, $this->managers)) {
            $errMsg = sprintf('Invalid manager name %s', $managerName);
            throw new Exception\InvalidManagerNameException($errMsg);
        }

        return new ManagerOptions($this->managers[$managerName]);
    }
1142808
public function getOptionValue($optionName)
    {
        if (!isset($this->options[$optionName])) {
            throw new \InvalidArgumentException(sprintf('Invalid option name "%s", possible options: %s', $optionName, implode(', ', array_keys($this->options))), __LINE__);
        }
        return array_key_exists('value', $this->options[$optionName]) ? $this->options[$optionName]['value'] : $this->options[$optionName]['default'];
    }
499804
public static function setApplicationDocumentManager(Application $application = null, $dmName)
    {
        if (is_null($application)) {
            throw new \InvalidArgumentException('Application instance needed!');
        }

        $helperSet = $application->getHelperSet();

        /** @var ManagerRegistry $doctrine */
        $doctrine = $helperSet->get('doctrine_mongodb');

        /** @var DocumentManager $dm */
        $dm = $doctrine->getManager($dmName);

        $helperSet->set(new DocumentManagerHelper($dm), 'dm');
    }
997678
public function get($name)
    {
        $this->checkNameIsString($name);

        if (isset($this->encrypters[$name])) {
            $encrypter = $this->encrypters[$name];
        } else {
            if (isset($this->configs[$name])) {
                $config = $this->configs[$name];
                $encrypter = new ManagedEncrypter($config);

                $this->encrypters[$name] = $encrypter;
            } else {
                throw new \InvalidArgumentException('Unknown encrypter (' . $name . ')');
            }
        }

        return $encrypter;
    }
348434
public function deregister(string $name): ManagerInterface
    {
        if (!$name) {
            throw DeregisterException::blank();
        } elseif (!$this->isRegistered($name)) {
            throw DeregisterException::missing($name);
        }

        unset($this->shortcodes[$name]);

        return $this;
    }
605420
public function add($manager)
    {
        if (!is_string($manager)) {
            throw new \InvalidArgumentException('ManagerList::add requires $manager to be a string.');
        }

        $this->managerList[$manager] = $manager;
        $this->managerStatus[self::FLAG_AVAILABLE][$manager] = $manager;

        return $this;
    }
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);
    }
156029
public function handle(ManagerRegistry $registry)
    {
        $names = $this->option('em') ? [$this->option('em')] : $registry->getManagerNames();

        foreach ($names as $name) {
            $em = $registry->getManager($name);

            if ($this->option('from-database') === true) {
                $databaseDriver = new DatabaseDriver(
                    $em->getConnection()->getSchemaManager()
                );

                $em->getConfiguration()->setMetadataDriverImpl(
                    $databaseDriver
                );

                if (($namespace = $this->option('namespace')) !== null) {
                    $databaseDriver->setNamespace($namespace);
                }
            }

            $cmf = new DisconnectedClassMetadataFactory();
            $cmf->setEntityManager($em);
            $metadata = $cmf->getAllMetadata();
            $metadata = MetadataFilter::filter($metadata, $this->option('filter'));

            // Process destination directory
            if (!is_dir($destPath = $this->argument('dest-path'))) {
                mkdir($destPath, 0775, true);
            }
            $destPath = realpath($destPath);

            if (!file_exists($destPath)) {
                throw new \InvalidArgumentException(
                    sprintf("Mapping destination directory '<info>%s</info>' does not exist.",
                        $this->argument('dest-path'))
                );
            }

            if (!is_writable($destPath)) {
                throw new \InvalidArgumentException(
                    sprintf("Mapping destination directory '<info>%s</info>' does not have write permissions.",
                        $destPath)
                );
            }

            $toType = strtolower($this->argument('to-type'));

            $exporter = $this->getExporter($toType, $destPath);
            $exporter->setOverwriteExistingFiles($this->option('force'));

            if ($toType == 'annotation') {
                $entityGenerator = new EntityGenerator();
                $exporter->setEntityGenerator($entityGenerator);

                $entityGenerator->setNumSpaces($this->option('num-spaces'));

                if (($extend = $this->option('extend')) !== null) {
                    $entityGenerator->setClassToExtend($extend);
                }
            }

            if (count($metadata)) {
                foreach ($metadata as $class) {
                    $this->info(sprintf('Processing entity "<info>%s</info>"', $class->name));
                }

                $exporter->setMetadata($metadata);
                $exporter->export();

                $this->info(PHP_EOL . sprintf(
                        'Exporting "<info>%s</info>" mapping information to "<info>%s</info>"', $toType, $destPath
                    ));
            } else {
                $this->info('No Metadata Classes to process.');
            }
        }
    }
682067
public function get($identifier)
    {
        if(!isset($this->managers[$identifier]))
            throw new InvalidArgumentException('A manager with that identifier does not exist.');

        return $this->managers[$identifier];
    }
549467
public function get(string $alias): ManagerInterface
    {
        if (!\array_key_exists($alias, $this->managers)) {
            throw new \InvalidArgumentException(\sprintf('The manager "%s" does not exist', $alias));
        }

        return $this->managers[$alias];
    }
851441
public function setConnectionManager(ManagerInterface $manager)
    {
        $this->connectionManager = $manager;
        foreach ($this->servers as $server) {
            $this->connectionManager->addServer($server);
        }
    }
823907
public function getIndexMetadata($contextName)
    {
        if (!isset($this->indexMetadatas[$contextName])) {
            throw new \InvalidArgumentException(sprintf(
                'Context name "%s" not known, known contexts: "%s"',
                $contextName, implode('", "', array_keys($this->indexMetadatas))
            ));
        }

        return $this->indexMetadatas[$contextName];
    }
585230
public function getOption($key)
    {
        if (!isset($this->options[$key])) {
            throw InvalidOptionException::build([], ['option' => $key]);
        }

        return $this->options[$key];
    }
157353
protected function parseOptions($filename)
    {
        $options = $this->loadYaml($filename);
        if (is_array($options)) {
            $this->options = $options;
        } else {
            throw new \InvalidArgumentException(sprintf('Settings contained by "%s" are not valid as the settings are not contained by an array: "%s"', $filename, gettype($options)), __LINE__);
        }
        return $this;
    }
885201
public function getManagerConfig($name)
	{
		if ($this->managerBag->has($name)) {
			$config = $this->managerBag->get($name);
			
			if (null === $config['template']) {
				$config['template'] = $this->defaultManagerConfig['template'];
			}
		} elseif (class_exists($name)) {
			$config = $this->defaultManagerConfig;
			$config['class'] = $name;
		} else {
			throw new \InvalidArgumentException(sprintf('The "%s" configuration key is not attached to a pagination manager.', $name));
		}
		
		return $config;
	}
428993
protected function initModelManager()
    {
        $managerClass = $this->getModel();
        $modelManager = $this->newModelManagerInstance($this->getModel());
        if ($modelManager instanceof RecordManager) {
            $this->modelManager = $this->newModelManagerInstance($this->getModel());
        } else {
            throw new Exception(
                "invalid ModelManager name [$managerClass] 
                for controller [" . $this->getClassName() . "]"
            );
        }
    }
665433
public function setName(string $name): AbstractSuggest
    {
        if (empty($name)) {
            throw new InvalidException('Suggest name has to be set');
        }
        $this->_name = $name;

        return $this;
    }