Set element value

@param int $index
@param mixed $value

@return Vector
2977
public function set($index, $value) : Vector
    {
        $values = $this->_set($index, $value, true);
        $this->setValues($values);
        return $this;
    }
1034335
public function setElementBy($element, $value, $nodeValue)
    {
        $xql = "//*[@$element='$value']";

        if (is_object($nodeValue)) {
            $result = $this->query($xql)->item(0)->appendChild($this->importNode($nodeValue, true));
        } else {
            $result = $this->query($xql)->item(0)->nodeValue = $nodeValue;
        }

        return $result;
    }
455398
public static function forIndex(string $index, string $value, ?\Throwable $previous = null): self
    {
        return new self("The node could not be found by ({$index}:{$value}).", $previous);
    }
1206716
public function insert($index, $value) {
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		//Permit 0-index insertion
		if(!$this->offsetExists($index)){
			throw new \OutOfRangeException('$index is invalid');
		}
		
		\array_splice($this->_Arr, $index, 0, array($value));
		
		return $this;
		
	}
437445
public function set(int $index, $value): Sequence
    {
        $this->offsetSet($index, $value);

        return $this;
    }
656390
public function setValue(string $value = null) : Element
    {
        if (!is_null($value)) {
            $tmp = preg_replace('/[^\d]/', '', $value);
            if (strlen($tmp)) {
                $value = $tmp;
                if ($value{0} != '0') {
                    $value = "0$value";
                }
            }
        }
        return parent::setValue($value);
    }
1098368
public function add($index, $value): Utility
    {
        if (is_null($this->get($index))) {
            return $this->set($index, $value);
        }

        return $this;
    }
1048685
public function add($element, $index = null) {
		if ($index === null) {
			$this->collection[$this->size()] = $element;
		} else {
			array_splice($this->collection, $index, 0, $element);
		}
		
		return $this;
	}
608885
public function setValue($value)
    {
        $this->checked = (!is_array($value)) ? [$value] : $value;
        if ((count($this->checked) > 0) && ($this->hasChildren())) {
            foreach ($this->childNodes as $child) {
                if ($child instanceof Input\Checkbox) {
                    if (in_array($child->getValue(), $this->checked)) {
                        $child->check();
                    } else {
                        $child->uncheck();
                    }
                }
            }
        }
        return $this;
    }
674703
public function offsetSet ($index, $value)
	{
		if (!is_numeric($index)) {
			throw new \OutOfBoundsException('Out of bounds: you are trying to set a non-numeric index.');
		}

		if ($index > $this->count() || $index < 0) {
			throw new \OutOfBoundsException("Invalid index {$index}");
		}

		$this->storage[$index] = $value;

		return null;
	}
25243
public function set($index, $value)
    {
        $config = $this;
        $keys = explode('.', $index);

        foreach ($keys as $key) {
            if (!isset($config->{$key})) {
                $config->{$key} = new self();
            }

            $config = &$config->{$key};
        }

        if (is_array($value)) {
            $config = new self($value);
        } else {
            $config = $value;
        }
    }
783090
public function setInternalValue($value)
    {
        if ($value instanceof \ArrayObject) {
            $value = $value->getArrayCopy();
        }

        if ($value instanceof \Iterator) {
            $value = iterator_to_array($value);
        }

        // force null values conversion to empty arrays
        if (is_null($value)) {
            $value = [];
        }

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

        $this->clear();

        foreach ($value as $k => $v) {
            $this->set($k, $v);
        }

        return $this;
    }
586931
protected function setValue($value)
    {
        if (!isset($this->value) || null === $this->value) {
            $this->value = $value;
        }

        return $this;
    }
657004
public V setValueAt(int index, V value) {
        index = (index << 1) + 1;
        V old = (V)mArray[index];
        mArray[index] = value;
        return old;
    }
539735
function setValue($value)
    {
        $this->_createElementsIfNotExist();
        foreach (array_keys($this->_elements) as $key) {
            if (!$this->_appendName) {
                $v = $this->_elements[$key]->_findValue($value);
                if (null !== $v) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $v, $this);
                }

            } else {
                $elementName = $this->_elements[$key]->getName();
                $index       = strlen($elementName) ? $elementName : $key;
                if (is_array($value)) {
                    if (isset($value[$index])) {
                        $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value[$index], $this);
                    }
                } elseif (isset($value)) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value, $this);
                }
            }
        }
    }
598220
public function setValue($value)
	{
		$this->value = $value;

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

		$this->recursiveAssignValue($value, $this->getContents());

		return $this;
	}
409848
public function offsetSet($index, $value): BaseCollection
    {
        $this->validate($value);

        parent::offsetSet($index, $value);

        return $this;
    }