设置数据项

@param string $key
@param mixed  $value
436772
public function set(string $key, $value)
    {
        if (! is_array($value)) {
            $value = [$value];
        }

        parent::set($key, [
            'value' => $value,
            'originalKey' => $key
        ]);
    }
1162148
public function set($key, $value)
    {
        $this->nestedKeyCache = [];

        if ($this->isNestedKey($key)) {
            $this->setNestedValueByKey($key, $value);

            return;
        }

        $this->items[$key] = $value;
    }
575055
public function setAttribute( $key, $value ) {
		$this->setAttributes( array_merge(
			$this->getAttributes(),
			[$key => $value]
		) );
	}
1018637
public function push($value, $key = null)
    {
        if (is_null($key)) {
            $this->items[] = $value;
        } else {
            $this->items[$key] = $value;
        }
    }
344258
public function set(string $key, $value)
    {
        $array = &$this->input;
        $keys = explode('.', $key);

        while (count($keys) > 1) {
            $k = array_shift($keys);
            if (!isset($array[$k]) || ! is_array($array[$k])) {
                $array[$k] = [];
            }
            $array = &$array[$k];
        }

        $array[array_shift($keys)] = $value;
        $this->cache[$key] = &$value;
    }
1355718
public function set($key, $value)
    {
        $setting = SettingModel::create(
            [
                'key' => $key,
                'value' => $value,
            ]
        );

        return $setting ? $value : false;
    }
249651
public function set($key, $value = null)
     {
         if (isset($this->_settings->$key)) {
             $this->_settings->$key = $value;
         }

         return $this->_settings->$key;
     }
953477
public function push($key, $value)
    {
        $config = $this->get($key);

        $this->setSingleItem($key, \array_push($config, $value));
    }
1290848
public function addValue(string $key, string $value) : void
    {
        $this->map[$key] = $value;
    }
1238195
private function validate($key, $value) {
    if ($this->keyValidation) {
      $cb = $this->keyValidation;
      $cb($key);
    }
    if ($this->valueValidation) {
      $cb = $this->valueValidation;
      $cb($value);
    }
  }
159720
function set($key, $value)
    {
        $index = array_search($key, $this->keys);

        if ($index !== false) {
            $this->values[$index] = $value;
        } else {
            $this->keys[] = $key;
            $this->values[] = $value;
        }
    }
608710
public function set(string $key, $value)
    {
        $value = static::format($value);
        parent::set($key, $value);
    }
617272
private function set($key, $value = "")
    {
        if (property_exists($this, $key)) {
            $key = implode('', array_map('ucfirst', explode('_', $key)));
            $this->{'set' . $key}($value);
        }
    }
736423
public static function data($key, $value)
    {
        if ($value === null) {
            unset(self::$shared[$key]);
        } else {
            self::$shared[$key] = $value;
        }
    }
511721
public function setValue($key, $value)
    {
        $this->langstrings[$key] = $value;
        $this->debug('SetValue ' . $key . ' => ' . $value);
    }
1081692
public function set($key, $value)
    {
        $method = 'setter' . ucfirst($key);
        if (method_exists($this, $method)) {
            $value = $this->$method($value);
        }
        $this->setRaw($key, $value);
    }
1095993
public function delete(string $value, string $key = null)
    {
        // Checks if a key was given
        if (isset($key)) {

            // Any key could be use in the where clause
            $query = 'DELETE FROM ' . $this->table . ' WHERE ' . $key . ' = ?';
        } else {
            // The id key would be use in the where clause
            $query = 'DELETE FROM ' . $this->table . ' WHERE id = ?';
        }
        // Executes the query
        $this->database->action($query, [$value]);
    }