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;
    }