Add or Retrive Settings of the form.

@param array|null $settings
@return array|Form
430713
public function settings($settings = null)
    {
        if (is_null($settings)) {
            return $this->settings;
        }

        $this->settings = $settings;
        return $this;
    }
1213398
public function mergeAttachmentOptions(array $settings)
    {
        // Make sure default options are loaded.
        if ($this->attachmentOptions === null) {
            $this->attachmentOptions();
        }

        $this->attachmentOptions = array_merge(
            $this->attachmentOptions,
            $this->parseAttachmentOptions($settings)
        );

        return $this;
    }
212943
protected function storeDateSettings($settings)
    {
        // Set up start/end dates:
        $from = empty($settings['from'])
            ? $this->stateManager->loadDate() : $settings['from'];
        $until = empty($settings['until']) ? null : $settings['until'];
        $this->setStartDate($from);
        $this->setEndDate($until);
    }
520049
public function setSelectizeOptions(array $settings)
    {
        $this->selectizeOptions = array_merge(
            $this->defaultSelectizeOptions(),
            $this->parseSelectizeOptions($settings)
        );

        return $this;
    }
566004
public function init($setting = array())
    {
        if (!is_array($setting) || count($setting) == 0) return $this;
        foreach ($setting as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = (string)$value;
            }
        }

        return $this;
    }
688278
public function addSetting(UserSetting $setting)
    {
        $this->settings->set($setting->getName(), $setting);

        return $this;
    }
347993
protected function removeDots(array $settings): array
    {
        $conf = [];
        foreach ($settings as $key => $value) {
            $conf[$this->removeDotAtTheEnd($key)] = \is_array($value) ? $this->removeDots($value) : $value;
        }
        return $conf;
    }
1070478
public function setSettings( $settings )
    {
        if ( ! empty( $settings ) )
        {
            foreach ( $settings as $name => $value )
            {
                $this->setSetting( $name, $value );
            }
        }

        return $this;
    }
113183
public static function addSettings(array $defaults)
    {
        return [
            'up' => function (Builder $schema) use ($defaults) {
                $settings = new DatabaseSettingsRepository(
                    $schema->getConnection()
                );

                foreach ($defaults as $key => $value) {
                    $settings->set($key, $value);
                }
            },
            'down' => function (Builder $schema) use ($defaults) {
                $settings = new DatabaseSettingsRepository(
                    $schema->getConnection()
                );

                foreach (array_keys($defaults) as $key) {
                    $settings->delete($key);
                }
            }
        ];
    }
674275
public function saveSettings($settings)
    {
        if (isset($settings['name']) && isset($this->config['servers'][$settings['name']])) {
            return $this->saveConfig(array_merge($this->config['servers'][$settings['name']], $settings));
        }
    }
1090000
public function enqueue( $settings ) {
		$styles = $this->get_styles();

		if ( ! empty( $styles ) ) {
			$settings['styles'][] = [ 'css' => $styles ];
		}

		return $settings;
	}
1169699
public static function addForm($settings = [])
    {
        $form = self::createElement('form');

        if (array_get($settings, 'file_upload')) {
            $form->addElement('input')->type('hidden')->name('MAX_FILE_SIZE')->value(self::getFileUploadMaxSize());
        }

        return $form;
    }
410997
protected function createMailer( $settings = null ) {
		$settings = is_array( $settings ) ? $settings : [];
		$mailer = new PHPMailer( true );
		foreach ( array_merge( $this->settings, $settings ) as $key => $value ) {
			$mailer->set( $key, $value );
		}
		return $mailer;
	}
1179044
public function resolve(array $settings = [])
    {
        return new YamlDriver(
            Arr::get($settings, 'paths'),
            Arr::get($settings, 'extension', YamlDriver::DEFAULT_FILE_EXTENSION)
        );
    }
833220
public function setFromRequest($settings)
    {
        $this->removeTokenKey($settings);

        foreach ($settings as $settingName => $settingValues) {
            $this->set($settingName, $settingValues);
        }
    }
1294021
public function mock(array $settings = array())
    {
        $this->mocked['REQUEST_TIME'] = time();
        $settings = array_merge($this->mocked, $settings);

        $this->parse($settings);
    }
344854
public function injectSettings(array $settings)
    {
        $this->sessionCookieName = $settings['session']['name'];
        $this->sessionCookieLifetime = (integer)$settings['session']['cookie']['lifetime'];
        $this->sessionCookieDomain = $settings['session']['cookie']['domain'];
        $this->sessionCookiePath = $settings['session']['cookie']['path'];
        $this->sessionCookieSecure = (boolean)$settings['session']['cookie']['secure'];
        $this->sessionCookieHttpOnly = (boolean)$settings['session']['cookie']['httponly'];
        $this->garbageCollectionProbability = $settings['session']['garbageCollection']['probability'];
        $this->garbageCollectionMaximumPerRun = $settings['session']['garbageCollection']['maximumPerRun'];
        $this->inactivityTimeout = (integer)$settings['session']['inactivityTimeout'];
    }