Register MongoDB ODM document managers.

@param array $settings

@throws \RuntimeException
767910
protected function registerMongoDBDocumentManagers(array $settings)
    {
        if (array_key_exists('connection', $settings)) {
            $settings = [$settings];
        }

        foreach ($settings as $name => $config) {
            if (!is_string($name)) {
                $name = $this->getOption(static::MONGODB_MANAGER_NAME);
            }

            $this->addBuilder(new MongoDBBuilder($config, $name));
        }
    }
847489
public function update(array $settings)
    {
        foreach ($settings as $key => $value) {
            $this->getSettingOrFail($key);
        }

        $this->backend->setSettings($settings);
    }
603907
protected function setSettings(array $settings): void
    {
        $this->server->set(array_merge($this->defaultSettings, $this->settings, $settings));
    }
997525
private function applyFilters(array $settings): void
    {
        $data = $this->getSource();
        $data = array_filter(
            $data,
            function ($row) use ($settings) {
                foreach ($settings as $column => $filters) {
                    foreach ($filters as $filter => $value) {
                        // switch statement for filter
                        switch ($filter) {
                            case Grid\Grid::FILTER_EQ:
                                if ($row[$column] != $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_NE:
                                if ($row[$column] == $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GT:
                                if ($row[$column] <= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GE:
                                if ($row[$column] < $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LT:
                                if ($row[$column] >= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LE:
                                if ($row[$column] > $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LIKE:
                                if (!preg_match('/' . $value . '/', $row[$column])) {
                                    return false;
                                }
                                break;
                        }
                    }
                }
                return true;
            }
        );
        $this->setSource($data);
    }
352810
protected function addModelSettings(array &$settings)
    {
        $empty = $this->util->getTranslated()->getEmptyDropdownArray();

        $settings['elementClass'] = 'Select';
        $settings['multiOptions'] = $empty + $this->util->getDbLookup()->getUserConsents();
    }
724415
public function resolve(array $settings = [])
    {
        return new XmlDriver(
            Arr::get($settings, 'paths'),
            Arr::get($settings, 'extension', XmlDriver::DEFAULT_FILE_EXTENSION)
        );
    }
1139110
public function addSettings(array $settings)
    {
        foreach ($settings as $key => $value) {
            $this->addSetting($key, $value);
        }
    }
935974
public function addSettings( $settings )
    {
        $this->settings = ArrayUtils::merge(
            $this->settings,
            ArrayUtils::iteratorToArray( $settings )
        );

        return $this;
    }
874856
public function setAll(array $settings)
    {
        foreach ($settings as $name => $value) {
            if (is_string($name) && $this->exists($name)) { // avoid the logic exception
                $this->set($name, $value);
            }
        }
    }
1269409
public function configure(array $settings = [])
    {
        if (empty($this->commandName = array_get($settings, 'command_name'))) {
            throw new \Exception("Invalid configuration: missing command name.");
        }

        // Various ways to figure out how to run this thing
        // check settings, then global config, then use the OS to find it
        $this->commandPath = array_get($settings, 'command_path');
        if (empty($this->commandPath)) {
            $this->commandPath = $this->findCommandPath();
            if (empty($this->commandPath = $this->commandName)) {
                throw new \Exception("Failed to find a valid path to command for scripting.");
            }
        }

        $this->arguments = array_get($settings, 'arguments');
        $this->supportsInlineExecution = boolval(array_get($settings, 'supports_inline_execution', false));
        $this->inlineArguments = array_get($settings, 'inline_arguments');
        $this->fileExtension = array_get($settings, 'file_extension');
    }
1309967
protected function addModelSettings(array &$settings)
    {
        $empty = [];
        if (!$this->_fieldDefinition['gtf_required'] || $this->_fieldDefinition['gtf_field_default'] === null) {
            $empty = $this->util->getTranslated()->getEmptyDropdownArray();
        }

        $multi = explode(parent::FIELD_SEP, $this->_fieldDefinition['gtf_field_values']);

        $settings['elementClass'] = 'Select';
        $settings['multiOptions'] = $empty + array_combine($multi, $multi);
    }
424910
protected function registerSettingManagementInterface()
	{
		$this->app->bind('Mgallegos\DecimaAccounting\Accounting\Services\SettingManagement\SettingManagementInterface', function($app)
		{
			return new SettingManager(
				$app->make('Mgallegos\DecimaAccounting\Accounting\Repositories\Setting\SettingInterface'),
				$app->make('Mgallegos\DecimaAccounting\System\Repositories\AccountChartType\AccountChartTypeInterface'),
				$app->make('App\Kwaai\System\Repositories\Currency\CurrencyInterface'),
				$app->make('Mgallegos\DecimaAccounting\Accounting\Repositories\AccountType\AccountTypeInterface'),
				$app->make('Mgallegos\DecimaAccounting\System\Repositories\AccountType\AccountTypeInterface'),
				$app->make('Mgallegos\DecimaAccounting\Accounting\Repositories\Period\PeriodInterface'),
				$app->make('Mgallegos\DecimaAccounting\Accounting\Repositories\FiscalYear\FiscalYearInterface'),
				$app->make('Mgallegos\DecimaAccounting\Accounting\Repositories\Account\AccountInterface'),
				$app->make('Mgallegos\DecimaAccounting\System\Repositories\Account\AccountInterface'),
				$app->make('Mgallegos\DecimaAccounting\Accounting\Repositories\VoucherType\VoucherTypeInterface'),
				$app->make('Mgallegos\DecimaAccounting\System\Repositories\VoucherType\VoucherTypeInterface'),
				$app->make('Mgallegos\DecimaAccounting\Accounting\Repositories\CostCenter\CostCenterInterface'),
				$app->make('App\Kwaai\Security\Services\AuthenticationManagement\AuthenticationManagementInterface'),
				$app->make('App\Kwaai\Security\Services\JournalManagement\JournalManagementInterface'),
				$app->make('App\Kwaai\Security\Repositories\Journal\JournalInterface'),
				$app['db'],
				$app['translator'],
				$app['config']
			);
		});
	}
204461
public function add($settings)
    {
        if (is_array($settings)) {
            $settings = new $this->settings($settings);
        }

        if (!$settings instanceof ResourceSettings) {
            throw new InvalidInstanceException('Settings is not a valid instance of ' . ResourceSettings::class);
        }

        $settings->hasRequiredSettings();

        $settings->theme = $this->getThemeToUse($settings);

        $addKey = sprintf('_added.%s.%s', $settings->theme->getName(), $settings->key);

        if ($this->resources->has($addKey)) {
            $this->logger->warning("Key already exists in Themer: '{$settings->key}'");
            return;
        }

        if ($this->addResource($settings)) {
            $this->resources->add($addKey, true);

            ++$this->order;
        }
    }
108745
protected function registerMappingTypes(array $settings = [], EntityManagerInterface $manager)
    {
        foreach (Arr::get($settings, 'mapping_types', []) as $dbType => $doctrineType) {
            // Throw DBALException if Doctrine Type is not found.
            $manager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping($dbType, $doctrineType);
        }
    }
183341
protected function registerEntityManagers(array $settings)
    {
        if (array_key_exists('connection', $settings)) {
            $settings = [$settings];
        }

        foreach ($settings as $name => $config) {
            if (!is_string($name)) {
                $name = $this->getOption(static::RELATIONAL_MANAGER_NAME);
            }

            $this->addBuilder(new RelationalBuilder($config, $name));
        }
    }
435455
public static function setMany($settings = [], $defaultSettings = [])
    {
        $settings = static::parseDefaultOptions($settings, $defaultSettings);

        array_walk($settings, function ($value, $key) {
            static::set($key, $value);
        });
    }
928422
public function injectSettings(array $settings): void
    {
        if (isset($settings['security']['authentication']['authenticationStrategy'])) {
            $authenticationStrategyName = $settings['security']['authentication']['authenticationStrategy'];
            switch ($authenticationStrategyName) {
                case 'allTokens':
                    $this->authenticationStrategy = Context::AUTHENTICATE_ALL_TOKENS;
                    break;
                case 'oneToken':
                    $this->authenticationStrategy = Context::AUTHENTICATE_ONE_TOKEN;
                    break;
                case 'atLeastOneToken':
                    $this->authenticationStrategy = Context::AUTHENTICATE_AT_LEAST_ONE_TOKEN;
                    break;
                case 'anyToken':
                    $this->authenticationStrategy = Context::AUTHENTICATE_ANY_TOKEN;
                    break;
                default:
                    throw new Exception('Invalid setting "' . $authenticationStrategyName . '" for security.authentication.authenticationStrategy', 1291043022);
            }
        }
    }