set values for insert or update.

@param string|array $name
@param string|null $value
@return $this
767180
public function value( $name, $value = null )
    {
        if ( is_array( $name ) ) {
            $this->values += $name;
        } elseif ( func_num_args() > 1 ) {
            $this->values[ $name ] = $value;
        }
        return $this;
    }
1113892
public function setVariable(string $name, $value = null): self
    {
        $this->variables[$name] = $value;

        return $this;
    }
65456
public function set($name, $value = null)
    {
        if (is_array($name)) {
            $insert = [];
            $delete = [];

            foreach ($name as $key => $val) {
                $val = $this->_merge($key, $val);
                $insert[] = [$key, $val];
                $delete[] = $key;

                $this->_data[$key] = $val;
            }
            if (count($insert) > 0) {
                $this->_db->createCommand()->delete($this->tableName, ['IN', 'name', $delete])->execute();
                $this->_db->createCommand()->batchInsert($this->tableName, ['name', 'value'], $insert)->execute();
            }
        } else {
            $value = $this->_merge($name, $value);

            if (array_key_exists($name, $this->getData()) === false) {
                $this->_db->createCommand()->insert($this->tableName, ['name' => $name, 'value' => $value])->execute();
            } else {
                $this->_db->createCommand()->update($this->tableName, ['value' => $value], 'name = :name', [':name' => $name])->execute();
            }
            $this->_data[$name] = $value;
        }

        $this->_setCache();
    }
895628
public function set($name, $value = null)
    {
        if ($this->has($name) && $this->get($name) !== $value)
        {
            $this->offsetSet($name, $value);

            //Reset the model
            $this->__model->reset(array($name));
        }

        return $this;
    }
593475
public static function set($name,$value=null)
    {
        if(is_array($name)){
            self::$config=array_merge(self::$config,$name);
            return;
        }
        if(strstr($name,'.')===false){
            self::$config[$name]=$value;
        }else{
            list($l,$r)=explode('.',$name);
            self::$config[$l][$r]=$value;
        }
    }
772371
public function set($name, $value)
    {
        $this->stale = true;

        try {
            if ($value === null) {
                $this->model->where('name', '=', $name)->delete();
            } else {
                $this->model->updateOrCreate(compact('name'), compact('value'));
            }
        } catch (Exception $e) {
            throw new WriteException($e);
        }
    }
357283
public function setRaw($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $innerName => $innerValue) {
                $this->replace($innerName, $innerValue);
            }
        } else {
            $this->replace($name, $value);
        }

        // return is for chaining
        return $this;
    }
282209
protected function setData($name, $value = null)
    {
        if (is_array($name)) {
            $this->data = array_merge($this->data, $name);
        }
        elseif (is_string($name)) {
            $this->data[$name] = $value;
        }

        return $this;
    }
654643
public function setOption($name, $value = null)
    {
        // Set options
        if (is_array($name)) {
            foreach ($name as $k => $v) {
                $this->setOption($k, $v);
            }
            return $this;
        }

        if (method_exists($this, $method = 'set' . $name)) {
            return $this->$method($value);
        } else {
            $this->$name = $value;
            return $this;
        }
    }
1307945
public function setQuery($name, $value = null)
    {
        if (!is_array($name)) {
            $this->gets[$name] = $value;
        } else {
            $this->gets = $name + $this->gets;
        }
        return $this;
    }
383961
public static function insert(String $name = NULL, $value = NULL) : Bool
    {
        $name  = self::$settings['name']  ?? $name;
        $input = self::$settings['input'] ?? false;
        $value = self::$settings['value'] ?? $value;

        self::$settings = [];

        return Method::$input($name, $value);
    }
911387
public function set($name, $value)
    {
        if (is_array($value)) {
            $this->__options[$name] = $this->getInstance()->merge($value);
        } else {
            $this->__options[$name] = $value;
        }

        return $this;
    }
832806
private function updateAttribute($name, $value)
    {
        $attribute = $this->getAttr($name);

        if (! is_null($attribute)) {
            $attribute->addContent($value);

            $this->put($name, $attribute);
        }

        return $this;
    }
1118636
public function set($name, $value = null)
    {
        if ($name === 'value') {
            $value = htmlspecialchars($value);
        }
        parent::set($name, $value);

        return $this;
    }
673212
public function set(string $name, $value = null): self
    {
        $this->variables[$name] = $value;
        return $this;
    }
136741
public function offsetSet($name, $value)
    {
        if (is_array($value)) {
            $value = new self($value, $this->dataobject);
        }

        if ($name === null) {
            $this->data[] = $value;
        } else {
            $this->data[$name] = $value;
        }
    }
177025
public function put($name, $value = null)
    {
        if ($name == []) {
            return $this;
        }

        $newValues = $name;

        if (! is_array($name)) {
            $newValues = [$name => $value];
        }

        $newContent = array_merge($this->all(), $newValues);

        $this->setContent($newContent);

        return $this;
    }