public function setElementInsteadOf($targetName, $element, $name = null) {
		if (! isset($this->_elements[$targetName])) {
			return $this;
		}
		
		$elements = [];
		
		foreach ($this->_elements as $existsName => $existsElement) {
			
			if ($targetName === $existsName) {
				if ($name === null) {
					$elements[] = $element;
				} else {
					$elements[$name] = $element;
				}
			} else {
				$elements[$existsName] = $existsElement;
			}
		}
		
		$this->_elements = $elements;
		
		return $this;
	}
public function setElementInsteadOf($targetName, $element, $name = null) {
		if (! isset($this->_elements[$targetName])) {
			return $this;
		}
		
		$elements = [];
		
		foreach ($this->_elements as $existsName => $existsElement) {
			
			if ($targetName === $existsName) {
				if ($name === null) {
					$elements[] = $element;
				} else {
					$elements[$name] = $element;
				}
			} else {
				$elements[$existsName] = $existsElement;
			}
		}
		
		$this->_elements = $elements;
		
		return $this;
	}
public function setElementInsteadOf ( $ targetName , $ element , $ name = null ) { if ( ! isset ( $ this -> _elements [ $ targetName ] ) ) { return $ this ; } $ elements = [ ] ; foreach ( $ this -> _elements as $ existsName => $ existsElement ) { if ( $ targetName === $ existsName ) { if ( $ name === null ) { $ elements [ ] = $ element ; } else { $ elements [ $ name ] = $ element ; } } else { $ elements [ $ existsName ] = $ existsElement ; } } $ this -> _elements = $ elements ; return $ this ; }
Replace the existing element with the new element with the new name, preserving the order

@param  string | int $targetName
@param  mixed $element
@param  string | int $name
@return MultiElementsAbstract
Replace the existing element with the new element with the new name preserving the order