Put a value in the store.

@param string|array    $name
@param string|int|null $value

@return $this
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;
    }
832806
private function updateAttribute($name, $value)
    {
        $attribute = $this->getAttr($name);

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

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

        return $this;
    }
220768
public function set($name, $value)
  {
    if (is_null($value)) {
      unset($this->vars[$name]);
    } else {
      $this->vars[$name] = $value;
    }

    return $this;
  }
566365
public function setParam($name, $value=null) {
		if(is_array($name)) {
			foreach($name as $k=>$v)
				$this->setParam($k, $v);
			return $this;
		}
		$this->params[$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;
    }
1246779
public function set($name, $value) {
		\Asgard\Common\ArrayUtils::set($this->metas, $name, $value);
		return $this;
	}
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;
    }
251067
public function set($name, $value)
    {
        //If it's an object, save its ID as the parameter
        if(is_object($value) && method_exists($value, 'getId'))
        {
            $this->parameters[$name] = $value->getId();
        }

        //Just save the parameter
        else
        {
            $this->parameters[$name] = $value;
        }

        return $this;
    }
415025
public static function set($name, $value)
    {
        $key = static::getContextKey();
        $store = RequestContext::getServerBean('ConnectContextStore');
        if(!isset(static::$context[$key]))
        {
            static::$context[$key] = $store->read($key);
        }
        static::$context[$key][$name] = $value;
        $store->save($key, static::$context[$key]);
    }
147768
public function set($name, $value)
    {
        Config::modify()->set($this->class, $name, $value);
        return $this;
    }
589594
public function setValue($name, $value = '')
    {
        if (\is_array($name)) {
            foreach ($name as $key => $val) {
                if (isset($this->$key)) {
                    $this->$key = $val;
                }
            }
        } else {
            if (isset($this->$name)) {
                $this->$name = $value;
            }
        }
    }
673212
public function set(string $name, $value = null): self
    {
        $this->variables[$name] = $value;
        return $this;
    }
147533
public function setValue(string $name, $value): self
    {
        $this->data[$name] = $value;

        return $this;
    }
758369
public function setAttribute($name, ...$value)
    {
        $value = is_array(array_get($value, 0, '')) ? array_get($value, 0) : $value;
        $this->updateAttribute($name, $value, $this->getAttributeValueSeparator($name));

        return $this;
    }
1229470
public function setData($name, $value)
    {
        if (!is_null($this->new)) {
            //====================================================================//
            // Impact Block Data Array
            $this->new->data[$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();
    }
1113892
public function setVariable(string $name, $value = null): self
    {
        $this->variables[$name] = $value;

        return $this;
    }