original_string: public static function set($key, $value = null)
      {
          if (is_array($key)) {
              foreach ($key as $_key => $_value) {
                  static::set($_key, $_value);
              }
              return true;
          }
  
          $record = static::findRecord($key);
          if (!$record) {
              $record = new static;
              list($namespace, $group, $item) = $record->parseKey($key);
              $record->namespace = $namespace;
              $record->group = $group;
              $record->item = $item;
          }
  
          $record->value = $value;
          $record->save();
  
          static::$cache[$key] = $value;
          return true;
      }
code: public static function set($key, $value = null)
      {
          if (is_array($key)) {
              foreach ($key as $_key => $_value) {
                  static::set($_key, $_value);
              }
              return true;
          }
  
          $record = static::findRecord($key);
          if (!$record) {
              $record = new static;
              list($namespace, $group, $item) = $record->parseKey($key);
              $record->namespace = $namespace;
              $record->group = $group;
              $record->item = $item;
          }
  
          $record->value = $value;
          $record->save();
  
          static::$cache[$key] = $value;
          return true;
      }
code_tokens: public static function set ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { foreach ( $ key as $ _key => $ _value ) { static :: set ( $ _key , $ _value ) ; } return true ; } $ record = static :: findRecord ( $ key ) ; if ( ! $ record ) { $ record = new static ; list ( $ namespace , $ group , $ item ) = $ record -> parseKey ( $ key ) ; $ record -> namespace = $ namespace ; $ record -> group = $ group ; $ record -> item = $ item ; } $ record -> value = $ value ; $ record -> save ( ) ; static :: $ cache [ $ key ] = $ value ; return true ; }
docstring: Stores a setting value to the database.
  @param string $key Specifies the setting key value, for example 'system:updates.check'
  @param mixed $value The setting value to store, serializable.
  @return bool
docstring_tokens: Stores a setting value to the database .