@param $settingKeyId
@param array $params

@return Setting
439351
public function getSettingByKey($settingKeyId, array $params)
    {
        /** @var $query QueryBuilder */
        $params['settingKey'] = $settingKeyId;

        $qb = $this->getFindByQueryBuilder($params, null, 'e');

        return $qb->getQuery()->getOneOrNullResult();
    }
260525
public function setBindingKeys($bindingKeys)
    {
        if (is_array($bindingKeys) && !empty($bindingKeys)) {
            $n = 1;
            foreach ($bindingKeys as $bindingKey) {
                $key = 'bindingKey.' . $n;
                $this->setParameter($key, $bindingKey);
                $n += 1;
            }
        }
        return $this;
    }
999298
private function filter(Collection $settings, string $section, string $key, ?string $owner)
    {
        return $settings->filter(
            function (SettingInterface $setting) use ($section, $key, $owner) {
                return $section === $setting->getSection()
                    && $key === $setting->getKey()
                    && $owner === $setting->getOwner();
            }
        );
    }
798684
protected function getRemoteResourceRepositoryKey(ResourceSettings $settings) : string
    {
        return sprintf('scripts.remote.%s.%d', $this->getLocation($settings->head), $settings->order);
    }
1358608
public function set($key, $value)
    {
        $this->settings[$key] = $value;
        $this->store();

        return $value;
    }
4437
def get_setting(key, *default):
    """"""
    if default:
        return get_settings().get(key, default[0])
    else:
        return get_settings()[key]
232626
private static KNXMediumSettings getMedium(String id)
	{
		if (id.equals("tp0"))
			return TPSettings.TP0;
		else if (id.equals("tp1"))
			return TPSettings.TP1;
		else if (id.equals("p110"))
			return new PLSettings(false);
		else if (id.equals("p132"))
			return new PLSettings(true);
		else if (id.equals("rf"))
			return new RFSettings(null);
		else
			throw new KNXIllegalArgumentException("unknown medium");
	}
1363785
public function createOrUpdate($key, SettingBuilder $input, array $queryParams = [])
    {
        $response = $this->api->settings()->createOrUpdate($key, $input->toArray(), $queryParams);

        return new SettingResponse($response);
    }
435455
public static function setMany($settings = [], $defaultSettings = [])
    {
        $settings = static::parseDefaultOptions($settings, $defaultSettings);

        array_walk($settings, function ($value, $key) {
            static::set($key, $value);
        });
    }
1154684
public function customSetting(string $settingKey, $settingValue): self
    {
        $this->clientConfig[$settingKey] = $settingValue;
        return $this;
    }
783034
public static function findOrCreateBySettingName($settingName)
    {
        try {
            return self::findBySettingName($settingName);
        } catch (RecordNotFoundException $er) {
            $setting = new self();
            $setting->SettingName = $settingName;

            return $setting;
        }
    }
748793
public function mergeSettings(array $savedSettings, array $definedSettings)
    {
        // Test if the saved settings are for site or page. Only site settings have the category key
        $pageSetting = isset($savedSettings[0]->category) ? false : true;

        // Make index of saved setting keys to setting array for easy lookup
        $settingIndex = array_combine(array_column($savedSettings, 'setting_key'), array_keys($savedSettings));

        // Loop through defined settings and update with saved values and meta info
        foreach ($definedSettings as $defKey => $setting) {
            if (isset($settingIndex[$setting->key])) {
                $definedSettings[$defKey]->id = $savedSettings[$settingIndex[$setting->key]]->id;
                $definedSettings[$defKey]->setting_value = $savedSettings[$settingIndex[$setting->key]]->setting_value;
                $definedSettings[$defKey]->created_by = $savedSettings[$settingIndex[$setting->key]]->created_by;
                $definedSettings[$defKey]->created_date = $savedSettings[$settingIndex[$setting->key]]->created_date;
                $definedSettings[$defKey]->updated_by = $savedSettings[$settingIndex[$setting->key]]->updated_by;
                $definedSettings[$defKey]->updated_date = $savedSettings[$settingIndex[$setting->key]]->updated_date;

                // Remove saved setting from array parameter now that we have updated the setting definition
                unset($savedSettings[$settingIndex[$setting->key]]);
            } else {
                // If a matching saved setting was NOT found, then set default value
                $definedSettings[$defKey]->setting_value = $definedSettings[$defKey]->value;
            }

            // Amend setting keys to what is expected in template
            $definedSettings[$defKey]->setting_key = $setting->key;
            $definedSettings[$defKey]->input_type = $definedSettings[$defKey]->inputType;

            // Include select options array
            if ($definedSettings[$defKey]->inputType === 'select') {
                $definedSettings[$defKey]->options = array_column($definedSettings[$defKey]->options, 'name', 'value');
            }

            // Add setting catagory. Not needed for page settings, but not in the way either
            $definedSettings[$defKey]->category = 'custom';

            // Remove JSON keys to avoid confusion in template
            unset($definedSettings[$defKey]->key);
            unset($definedSettings[$defKey]->value);
            unset($definedSettings[$defKey]->inputType);
        }

        // Check remaining saved settings for orphaned settings.
        array_walk($savedSettings, function(&$row) use ($pageSetting) {
            if ($pageSetting || (isset($row->category) && $row->category === 'custom')) {
                $row->orphaned = true;
            }
        });

        // Append defined settings to end of saved settings array and return
        return array_merge($savedSettings, $definedSettings);
    }
999295
public static function getOption(...$params)
    {
        $that = self::getInstance();

        $key = array_shift($params);

        $col[] = isset($that->settings[$key]) ? $that->settings[$key] : 0;

        if (! count($params)) {
            return ($col[0]) ? $col[0] : '';
        }

        foreach ($params as $param) {
            $col = array_column($col, $param);
        }

        return (isset($col[0])) ? $col[0] : '';
    }
1247208
protected function getLocalResourceRepositoryKey(ResourceSettings $settings) : string
    {
        return sprintf(
            'scripts.local.%s.%s.%d',
            $settings->theme->getKey(),
            $this->getAttributes($settings),
            $settings->order
        );
    }
970915
public static function key(string $key, array $params = []): string
    {
        $key = md5(serialize($key));
        if (count($params) > 0) {
            $key .= '-' . md5(serialize($params));
        }
        return $key;
    }
936084
public function copy(string $id, array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::POST,
            ResourceMethodEnum::COPY,
            $params,
            $id
        );
    }
748478
public static function set($enabled, $params)
    {
        $docs = self::documentations();
        $content = $docs['enabled'].self::enbaledFormat($enabled);
        $content .= $docs['kernel'].self::arrayFormat($params['kernel'], 'kernel');
        $content .= $docs['exceptions'].self::arrayFormat($params['exceptions'], 'exceptions');
        $content .= $docs['controllers'].self::arrayFormat($params['controllers'], 'controllers');
        $content .= $docs['models'].self::arrayFormat($params['models'], 'models');
        $content .= $docs['mailables'].self::arrayFormat($params['mailables'], 'mailables');
        if (array_has($params, 'querying')) {
            $content .= $docs['querying'].self::arrayFormat($params['querying'], 'querying');
        }

        $content = self::fileFormat($content);

        return self::setFile($content);
    }