Set setting

@param $section
@param $key
@param $value
@param null $type

@return bool
322031
public function setSetting($section, $key, $value, $type = null): bool
    {
        $model = static::findOne(['section' => $section, 'key' => $key]);

        if (empty($model)) {
            $model = new static();
        }

        $model->section = $section;
        $model->key = $key;
        $model->value = strval($value);

        if ($type !== null && ArrayHelper::keyExists($type, SettingType::getConstantsByValue())) {
            $model->type = $type;
        } else {
            $model->type = gettype($value);
        }

        return $model->save();
    }
363503
public function hasRelation(string $type, string $section = self::SCHEMA_CLASS): bool
    {
        return isset($this->config[$type][$section]);
    }
564152
public function set($key, $value)
    {
        if ($config = $this->getConfigFor($key)) {
            if ($type = Arr::get($config, 'type')) {
                @settype($value, $type);
            }
            $this->setting->set($key, $value);
        }
    }
1113725
private function resolverType(string $section, string $key)
    {
        return $this->typeRegistry->get(
            $this->schemaRegistry->get($section, $key)->getType()
        );
    }
561213
public function containValue(string $section, string $key): bool
    {
        if (isset($this->propertyData[$section]) && isset($this->propertyData[$section][$key])) {
            return true;
        }

        return false;
    }
91404
public function set(string $section, string $key, $value) : bool
    {
        $concat = $section . $this->sectionKeyDelimiter . $key;
        if (!static::CACHE_KEY_LONG) {
            if (!ConfigKey::validate($concat)) {
                throw new InvalidArgumentException(
                    'Arg section or key does not conform with .ini file and/or cache key requirements, concatted['
                    . $concat . '].'
                );
            }
        } elseif (!ConfigKeyLong::validate($concat)) {
            throw new InvalidArgumentException(
                'Arg section or key does not conform with .ini file and/or cache key requirements, concatted['
                . $concat . '].'
            );
        }
        return $this->cacheStore->set($concat, $value);
    }
809457
public function get($key, $section = 'basic', $type = null, $options = array(), $language = true)
    {
        // system settings
        if (array_key_exists($section, $this->settings)) {
            if (array_key_exists($key, $this->settings[$section])) {
                $settings = $this->settings[$section][$key];

                if ($settings->getType() === null && $type !== null) {
                    $settings->setType($type);
                    $this->em->flush();
                }

                return $settings;
            }
        }

        return $this->save($key, $section, $type, $options, $language);
    }
714006
public function youTryToGetSettingWithinSection($setting, $section)
    {
        $this->responseValue = $this->settingService->section($section)->get($setting, 'null');
    }
1268687
public void addSection(String key, String value) {
    this.sections = addToMap(key, value, this.sections);
  }
662943
public function setValues($values, $section = 0)
    {
        foreach ($values as $name => $val) {
            if (is_array($val)) {
                // let's ignore key values, we don't want them
                $i = 0;
                foreach ($val as $arval) {
                    $this->setValue($name, $arval, $section, $i++);
                }
            } else {
                $this->setValue($name, $val, $section);
            }
        }
    }
1050406
public function setSetting($key, $value = null)
    {
        $this->getSettingsComponent()->set($this->getSettingsCategory(), $key, $value);
    }
706900
public function set($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $configKey => $configValue) {
                $this->setSingleItem($configKey, $configValue);
            }
        } else {
            $this->setSingleItem($key, $value);
        }
    }
555999
public static function set($key, $value)
    {
        if (is_array($key)) {
            $now = self::self()->getContainer()['settings'];
            foreach ($key as $item) {
                $now = $now[$item];
            }
            $now = $value;
        } else {
            $settings = self::self()->getContainer()['settings'];
            $settings[$key] = $value;
        }
    }
1270310
public function has($key, $section = null, $searchDisabled = false)
    {
        if ($searchDisabled) {
            $setting = $this->model->findSetting($key, $section);
        } else {
            $setting = $this->get($key, $section);
        }
        return is_null($setting) ? false : true;
    }
664245
public function set(string $section, string $key, $value) : bool
    {
        return $this->config->set($this->concat($section, $key), $value);
    }
30818
public function has(string $section, string $key) : bool
    {
        return $this->config->has($this->concat($section, $key));
    }
930590
public function getOrSet($key, $value, $section = null, $type = null)
    {
        if ($this->has($key, $section, true)) {
            return $this->get($key, $section);
        } else {
            return $this->set($key, $value, $section, $type);
        }
    }