Sets a parameter by name.

@param string $key   The key
@param mixed  $value The value

@return $this
19913
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = &$this->parameters;

        while (count($keys) > 1) {
            $pkey = $keys[0];

            if (!array_key_exists($pkey, $data) || !is_array($data[$pkey])) {
                $data[$pkey] = [];
            }

            $data = &$data[$pkey];
            array_shift($keys);
        }

        $data[$keys[0]] = $value;

        return $this;
    }
257662
protected function getOrSetParam($key, $value = null)
    {
        if (is_null($value)) {
            return $this->params[$key];
        }

        $this->params[$key] = $value;

        return $this;
    }
86034
public function set($key, $value): self
    {
        if ($key === null) { // $x[] = ..
            $this->data[] = $value;
        } else {
            Arrays::set($this->data, $key, $value);
        }

        return $this;
    }
329896
public function setOption($key, $value)
    {
        $this->_validateOption($key);

        $this->_options[$key] = $value;

        return $this;
    }
673930
public function setOption($key, $value)
    {

        $this->getTargetConfigurableObject()
            ->setOption($this->getOptionName($key), $value);

        return $this;
    }
952106
public function setVariable($key, $value) {
        $this->_content = str_replace('#' . $key . '#', (string)$value, $this->_content);
        return $this;
    }
256722
public function setRawParam($key, $value = null)
    {
        if (is_array($key)) {
            $this->rawParams = $key;
        } else {
            $this->rawParams[$key] = $value;
        }

        return $this;
    }
1321986
public function parameter($key, $value = NULL)
	{
		if (func_num_args() === 1)
		{
			if ( ! array_key_exists($key, $this->_parameters))
			{
				throw new \InvalidArgumentException('Parameter not set: '.$key);
			}
			return $this->_parameters[$key];
		}
		$this->_parameters[$key] = $value;
		return $this;
	}
666671
protected function setArg($key, $value) {
            if ($value !== null) {
                $this->args[$key] = $value;
            }

            return $this;
        }
1113064
static function set( $key, $value ) {
        $me = self::getInstance();
        $me->parameters[$key] = $value;
    }
992812
function set($key, $value) {
        parent::set($key, $value);
        if($this !== $this->client->users) {
            $this->client->users->set($key, $value);
        }
        
        return $this;
    }
290020
public function set($key, $value)
	{
		Arr::set($this->body, $key, $value);

		return $this;
	}
184778
public function setOption($key, $value)
    {
        if ($value === NULL) {
            unset($this->options[$key]);

        } else {
            $this->options[$key] = $value;
        }

        return $this;
    }
1185226
public function offsetSet($key, $value)
    {
        if (is_null($key)) {
            $this->values[] = $value;
        } else {
            $this->values[$key] = $value;
        }

        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;
    }
1160436
public function set($key, $value = null)
    {
        $data = is_array($key) ? $key : [$key => $value];

        foreach ($data as $key => $value) {
            Arr::set($this->config, $key, is_array($value) ? new self($value) : $value);
        }

        return $this;
    }
1242601
public function setParam($key, $value)
        {
            $key = (string) $key;

            if ((null === $value) && isset($this->_params[$key])) {
                unset($this->_params[$key]);
            } elseif (null !== $value) {
                $this->_params[$key] = $value;
            }

            return $this;
        }