public function set($name, $value = '')
    {
        if (!$name) {
            return false;
        }

        /** @var SettingEntity $setting */
        $setting = SettingEntityRepository::findOneEntityByCriteria(['name' => $name]);

        if (!$setting) {
            $setting = new SettingEntity();
            $setting->setName($name);
        }
        $setting->setValue($value);
        $setting->save();

        // Update cache
        self::$_cached_settings[$name] = $value;
        Cacher::getInstance()->getDefaultCacher()->delete(self::CACHE_KEY);

        return true;
    }
public function set($name, $value = '')
    {
        if (!$name) {
            return false;
        }

        /** @var SettingEntity $setting */
        $setting = SettingEntityRepository::findOneEntityByCriteria(['name' => $name]);

        if (!$setting) {
            $setting = new SettingEntity();
            $setting->setName($name);
        }
        $setting->setValue($value);
        $setting->save();

        // Update cache
        self::$_cached_settings[$name] = $value;
        Cacher::getInstance()->getDefaultCacher()->delete(self::CACHE_KEY);

        return true;
    }
public function set ( $ name , $ value = '' ) { if ( ! $ name ) { return false ; } /** @var SettingEntity $setting */ $ setting = SettingEntityRepository :: findOneEntityByCriteria ( [ 'name' => $ name ] ) ; if ( ! $ setting ) { $ setting = new SettingEntity ( ) ; $ setting -> setName ( $ name ) ; } $ setting -> setValue ( $ value ) ; $ setting -> save ( ) ; // Update cache self :: $ _cached_settings [ $ name ] = $ value ; Cacher :: getInstance ( ) -> getDefaultCacher ( ) -> delete ( self :: CACHE_KEY ) ; return true ; }
Set new setting or update existing
@param $name
@param string $value
@return bool
Set new setting or update existing