Redaxscript\Db::setSetting PHP Méthode

setSetting() public méthode

set the setting
Since: 3.0.0
public setSetting ( string $key = null, string $value = null ) : boolean
$key string key of the item
$value string value of the item
Résultat boolean
    public function setSetting($key = null, $value = null)
    {
        return self::forTablePrefix('settings')->where('name', $key)->findOne()->set('value', $value)->save();
    }

Usage Example

Exemple #1
0
 /**
  * set the setting
  *
  * @since 3.0.0
  *
  * @param array $optionArray
  *
  * @return boolean
  */
 protected function _set($optionArray = [])
 {
     $key = $this->prompt('key', $optionArray);
     $value = $this->prompt('value', $optionArray);
     if ($key && $value) {
         return Db::setSetting($key, $value);
     }
     return false;
 }
All Usage Examples Of Redaxscript\Db::setSetting