Adds a new key/value pair at the list of keys, error on duplicate key.
@param mixed $key
@param mixed $value
@throws SimpleOrderedMapException
@return $this
178407
public function add($key, $value) {
    if ($this->exists($key)) {
      throw new SimpleOrderedMapException('Key already exists');
    }
    $this->keys[] = $key;
    $this->values[] = $value;
    return $this;
  }
470713
public function set( $key, $value ) {
		$key = $this->addKeyprefixIfNeeded( $key );
		$this->params[$key] = $value;
		return $this;
	}
534151
protected function setKeyValue($key, $value)
    {
        $this->validateKeyValue($key, $value);

        if ($this->isDefault($key, $value) && $this->isSaved($key)) {
            return $this->deleteRecord($key);
        } elseif ($this->isDefault($key, $value)) {
            return;
        } elseif ($this->isSaved($key)) {
            return $this->updateRecord($key, $value);
        }

        return $this->createRecord($key, $value);
    }
1065001
public function set($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $subkey => $value) {
                $this->set($subkey, $value);
            }
        } else {
            $this->parameters[$key] = $value;
        }
        return $this;
    }
1022823
public function prepend($key, $value)
	{
		if ($this->has($key))
		{
			unset($this->data[$key]);
		}

		$data = array($key => $this->close($value));

		$this->data = $data + $this->data;

		return $this;
	}
978397
protected function addDataInternal($value, $key) {
        if (null === $value || null === $key) {
            return $this;
        }
        $key = $this->processKey($key);
        if ($this->type === static::TYPE_DEFINED_ONLY && !array_key_exists($key, $this->shared)) {
            return $this;
        }
        return $this->addDataByScenario($value, $key);
    }
1335748
public function with($key, $value = '')
    {
        if (is_array($key)) {
            $this->appends = $key;
        } elseif (is_callable($value)) {
            $this->appends[$key] = value($value);
        } else {
            $this->appends[$key] = value($value);
        }

        return $this;
    }
239617
public function put(string $key, $value): self
    {
        if (!is_scalar($value)) {
            throw new \InvalidArgumentException(
                    'Argument 2 passed to ' . __METHOD__
                    . ' must be an instance of a scalar value.'
            );
        }

        $this->headers[$key] = (string) $value;
        return $this;
    }
277958
public function appends($keys, $value = null)
    {
        if (! is_array($keys)) {
            return $this->addQuery($keys, $value);
        }

        foreach ($keys as $key => $value) {
            $this->addQuery($key, $value);
        }

        return $this;
    }
280653
public function add($key, $value)
    {
        if (! is_null($key)) {
            $currentValue = Arr::get($this->payload, $key, []);

            if (! is_array($currentValue)) {
                $currentValue = Arr::wrap($currentValue);
            }

            $currentValue[] = $value;

            Arr::set($this->payload, $key, $currentValue);
        }

        return $this;
    }
920234
public function set($key, $value)
    {
        if ($key === null && is_object($value)) {
            $key = spl_object_hash($value);
        }

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

        return $this;
    }
1323784
protected function setParameter($key, $value)
    {
        if (is_array($value) && isset($value['value'])) {
            $value = $value['value'];
        }

        $this->parameters->set($key, $value);

        return $this;
    }
803827
public function updateSet($key, $value)
    {
        $update = ( ! $value instanceof SetUpdate)
            ? SetUpdate::createFromArray($value)
            : $value;

        $this->update->updateSet($key, $update->getOp());

        return $this;
    }
378287
public function append($key, $value)
	{
		if (!$this->has($key, $value))
		{
			$this->data[$key] = $this->close($value);
		}

		return $this;
	}
113818
public function addKeys($value)
    {
        if ($this->Keys === null) {
            $this->Keys = new \Protobuf\ScalarCollection();
        }

        $this->Keys->add($value);
    }
1030158
public function addData($key, $value) {
    if (!isset($this->data)) $this->data = array();
    $this->data[$key] = $value;
    return $this;
  }
780336
public function set($key, $value) {
        if (is_array($key)) {
            $this->data = array_merge($this->data, $key);
        } else {
            $this->data[ $key ] = $value;
        }
        return $this;
    }