@param ConfigurationInterface $moduleConfiguration

@return DatabaseAccessLayer\Interfaces\FilterInterface
346325
private function getFilter(ConfigurationInterface $moduleConfiguration)
    {
        $filterId = $moduleConfiguration->getDefaultFilterId();
        if (isset($this->filterCache[$filterId])) {
            return $this->filterCache[$filterId];
        }
        $filterConfiguration = $this->dbAdapter->getFilterDefinitionFromId($moduleConfiguration->getDefaultFilterId());
        $this->filterCache[$filterId] = $this->filterFactory->createFilter($filterConfiguration);

        return $this->filterCache[$filterId];
    }
317833
private function getFilter(string $filterId): ?FilterInterface
    {
        if ($this->filterLocator instanceof ContainerInterface && $this->filterLocator->has($filterId)) {
            return $this->filterLocator->get($filterId);
        }

        if ($this->filterLocator instanceof FilterCollection && $this->filterLocator->offsetExists($filterId)) {
            return $this->filterLocator->offsetGet($filterId);
        }

        return null;
    }
174761
protected function applyConfig(array $moduleConfiguration)
    {
        foreach ($moduleConfiguration['customer_group'] as $customerGroupData) {
            if (CustomerGroupQuery::create()->findOneByCode($customerGroupData['code']) === null) {
                $customerGroup = (new CustomerGroup)
                    ->setCode($customerGroupData['code']);

                foreach ($customerGroupData['descriptive'] as $descriptiveData) {
                    $customerGroup
                        ->setLocale($descriptiveData['locale'])
                        ->setTitle($descriptiveData['title'])
                        ->setDescription($descriptiveData['description']);
                }

                $customerGroup->save();
            }
        }

        if ($moduleConfiguration['default']) {
            $customerGroup = CustomerGroupQuery::create()->findOneByCode($moduleConfiguration['default']);
            if ($customerGroup !== null) {
                $this->resetDefault();

                $customerGroup
                    ->setIsDefault(true)
                    ->save();
            }
        }
    }
72678
protected function getConfiguration(InputInterface $input): ConsoleConfigInterface
    {
        // If the configuration to use is the default.
        if ($input->getOption('default')) {
            $this->validatePathsExist($input);
            // If it is a directory.
            if ($input->getOption('dir')) {
                return (new DefaultConsoleConfigFactory())
                    ->invokeDir($input->getArgument('source'), $input->getArgument('target'));
            }
            return (new DefaultConsoleConfigFactory())
                ->invokeFile($input->getArgument('source'), $input->getArgument('target'));
        }

        $path = $input->getOption('config');
        // If we have a "=" at the beginning of the option value
        $path = preg_replace('/^\=/', '', $path);

        $factory = $this->getConfigurationFactory($path);

        if ($input->getOption('dir')) {
            $this->validatePathsExist($input);
            return $factory->invokeDir(
                $path,
                $input->getArgument('source'),
                $input->getArgument('target')
            );
        }
        if ($input->getOption('file')) {
            $this->validatePathsExist($input);
            return $factory->invokeFile(
                $path,
                $input->getArgument('source'),
                $input->getArgument('target')
            );
        }
        return $factory->invoke($path);
    }
1046836
public function addConfigurationObject(ClassName $className, ObjectInterface $configurationObject): self
    {
        $this->objects[$className->getIdentifier()] = $configurationObject;

        return $this;
    }
1126535
private function getSubmodules(ModuleInterface $module)
    {
        if ($module instanceof SubmoduleInterface) {
            $module = $this->getModule($module->getParentIdentifier());
        }

        return $this->get('clastic.module_manager')
            ->getSubmodules($module->getIdentifier());
    }
947390
protected function getFilterSearch(PaginateFinderConfiguration $configuration) {
        $filter = array();
        $label = $configuration->getSearchIndex('label');
        $language = $configuration->getSearchIndex('language');
        if (null !== $label && $label !== '' && null !== $language && $language !== '' ) {
            $filter['labels.' . $language] = new \MongoRegex('/.*'.$label.'.*/i');
        }
        $siteId = $configuration->getSearchIndex('site');
        if (null !== $siteId && $siteId !== '') {
            $filter['site.$id'] = new \MongoId($siteId);
        }

        return $filter;
    }
89110
protected function applyConfig(array $moduleConfiguration)
    {
        foreach ($moduleConfiguration['smarty_filter'] as $smartyFilterData) {
            if (SmartyFilterQuery::create()->findOneByCode($smartyFilterData['code']) === null) {
                $smartyFilter = (new SmartyFilter())
                    ->setCode($smartyFilterData['code']);

                foreach ($smartyFilterData['descriptive'] as $descriptiveData) {
                    $smartyFilter
                        ->setLocale($descriptiveData['locale'])
                        ->setTitle($descriptiveData['title'])
                        ->setDescription($descriptiveData['description'])
                        ->setFiltertype($descriptiveData['type']);
                }

                $smartyFilter->save();
            }
        }
    }
716865
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var array  $appConfig */
        $appConfig = $serviceLocator->get('config');
        $doctrineConfig = array_key_exists('doctrine', $appConfig) ? $appConfig['doctrine'] : [];

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

        return new DoctrineOrmModuleConfig($doctrineConfig, $moduleOptions);
    }
305982
public function deleteModuleConfiguration(string $moduleId)
    {
        if (array_key_exists($moduleId, $this->moduleConfigurations)) {
            unset($this->moduleConfigurations[$moduleId]);
        } else {
            throw new DomainException('There is no module configuration with id ' . $moduleId);
        }
    }
316114
private function addParentFilter(ConfigInterface $config, ModelInterface $parentModel)
    {
        $environment     = $this->getEnvironment();
        $definition      = $environment->getDataDefinition();
        $basicDefinition = $definition->getBasicDefinition();

        if (!$basicDefinition->getParentDataProvider()) {
            return;
        }

        if ($basicDefinition->getParentDataProvider() !== $parentModel->getProviderName()) {
            throw new \RuntimeException(
                \sprintf(
                    'Parent provider mismatch: %s vs. %s',
                    $basicDefinition->getParentDataProvider(),
                    $parentModel->getProviderName()
                )
            );
        }

        // Apply parent filtering, do this only for root elements.
        if ($parentCondition = $definition->getModelRelationshipDefinition()->getChildCondition(
            $basicDefinition->getParentDataProvider(),
            $basicDefinition->getRootDataProvider()
        )) {
            $baseFilter = $config->getFilter();
            $filter     = $parentCondition->getFilter($parentModel);

            if ($baseFilter) {
                $filter = \array_merge($baseFilter, $filter);
            }

            $config->setFilter($filter);
        }
    }
454759
private function getConfigurationParameters(ConfigurationInterface $configuration)
    {
        $parameters = [];

        $values = $configuration->getValues();

        foreach ($configuration->getModel() as $parameterModel) {
            $parameterName = $parameterModel->getName();
            $parameterType = $parameterModel->getType();
            $parameterDataType = $parameterModel->getDataType();

            if (!array_key_exists($parameterName, $values)) {
                continue;
            }

            $value = $values[$parameterName];

            if ($value == $parameterModel->getDefaultValue()
                && !isset($this->persistedParameters[$configuration->getName()][$parameterName])
            ) {
                continue;
            }
            if (null !== $value && gettype($value) !== $parameterDataType) {
                $message = sprintf(
                    'Parameter "%s" of configuration "%s" must have value of "%s" type, "%s" type value provided.',
                    $parameterName,
                    $configuration->getName(),
                    $parameterDataType,
                    gettype($value)
                );

                throw new ConfigurationException($message);
            }

            $value = $this->parameterValueConverter->toString($value, $parameterType, $parameterModel->getOptions());

            $parameters[] = new Parameter($configuration->getName(), $parameterName, $parameterType, $value);
        }

        return $parameters;
    }
651234
protected function isMatchNameFilter(ScenarioInterface $scenario, $filterString)
    {
        $filter = new NameFilter($filterString);

        return $filter->isScenarioMatch($scenario);
    }
962994
public function getGeneratorForModule(ModuleInterface $module)
    {
        $type       = $module->getModularType();
        $collection = $this->getRouteCollectionForType($type);

        if (array_key_exists($type, $this->generators)) {
            return $this->generators[$type];
        }

        if (null === $this->options['cache_dir']) {
            return $this->generators[$type] = new $this->options['generator_class']($collection, $this->context, $this->logger);
        }

        $cacheClass = sprintf('%s_UrlGenerator', $type);

        $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'] . '/' . $cacheClass .'.php',
            function (ConfigCacheInterface $cache) use ($cacheClass, $collection) {
                /** @var GeneratorDumperInterface $dumper */
                $dumper = new $this->options['generator_dumper_class']($collection);

                $options = [
                    'class'      => $cacheClass,
                    'base_class' => $this->options['generator_base_class'],
                ];

                $cache->write($dumper->dump($options), $collection->getResources());
            }
        );

        require_once $cache->getPath();

        return $this->generators[$type] = new $cacheClass($this->context, $this->logger);
    }
498097
function getServices(Container $moduleContainer = null)
    {
        $conf = \Poirot\Config\load(__DIR__ . '/config/mod-oauth2client.services', true);
        return $conf;
    }
1298469
public function getFilter($idOrConfig)
    {
        if ($idOrConfig instanceof FilterConfig) {
            $idOrConfig = $idOrConfig->getId();
        }
        return $this->getFilters()[$idOrConfig];
    }
175893
public function addSetting(ModuleSetting $moduleSetting): ModuleConfiguration
    {
        $this->settings[$moduleSetting->getName()] = $moduleSetting;

        return $this;
    }