Redaxscript\Db::setSetting PHP Method

setSetting() public method

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
return boolean
    public function setSetting($key = null, $value = null)
    {
        return self::forTablePrefix('settings')->where('name', $key)->findOne()->set('value', $value)->save();
    }

Usage Example

コード例 #1
0
ファイル: Setting.php プロジェクト: redaxmedia/redaxscript
 /**
  * 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