Replaces an item in this list with another item.

@param array|object $item
@param array|object $with
@return void;
769176
public function replace($item, $with)
    {
        foreach ($this->items as $key => $candidate) {
            if ($candidate === $item) {
                $this->items[$key] = $with;
                return;
            }
        }
    }
522056
public function item($item)
    {
        if (!$this->model) {
            $this->model = get_class($item);
        }

        $this->item = $item;

        return $this;
    }
653369
public function with($withs)
    {
        if ( ! is_array($withs)) {
            $withs = func_get_args();
        }

        $this->withs = $withs;

        return $this;
    }
713384
public function addItemToReplacementData( $itemId )
    {
        if ( !isset( $this->replacementData[$itemId] ) )
        {
            $this->replacementData[$itemId] = 0;
        }
        ++$this->replacementData[$itemId];
    }
631436
public function setParent($item)
    {
        if (is_object($item)) {
            if (!$item->exists()) {
                $item->write();
            }
            $this->setField("ParentID", $item->ID);
        } else {
            $this->setField("ParentID", $item);
        }
    }
166058
public function addAt(Item $item, $position = null)
    {
        if (0 === $position) {
            array_unshift($this->items, $item);
        } else if (null === $position) {
            $this->items[] = $item;
        } else if (count($this->items) <= $position) {
            $this->items[] = $item;
        } else {
            array_splice($this->items, $position, 0, [$item]);
        }

        $this->isUpdated = true;

        return $this;
    }
437739
public function add_item(cc_i_item &$item) {
        if (is_null($this->itemlist)) {
            $this->itemlist = array();
        }
        $this->itemlist[$item->identifier] = $item;
    }
583371
public void replaceWith(Node in) {
        Validate.notNull(in);
        Validate.notNull(parentNode);
        parentNode.replaceChild(this, in);
    }
630019
protected function removeItem($item)
    {
        if (is_string($item)) {
            $item = $this->findItem($item);
        }

        echo "    > removing $item->name ...";
        $time = microtime(true);
        $this->authManager->remove($item);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }
63990
public function removeItem(Item $item)
    {
        if ($this->items->contains($item)) {
            $this->items->removeElement($item);
            $item->setType(null);
        }

        return $this;
    }
1286609
public function replace($items = array(), $recursive = true)
	{
		$items = (array) $items;

		if ($recursive) {
			$this->data = array_replace_recursive($this->data, $items);
		} else {
			$this->data = $items;
		}
	}
601489
public void replace(T item) throws IOException {
        removeAll((Class)item.getClass());
        data.add(item);
        onModified();
    }
256469
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->setStorage($this);
        }

        return $this;
    }
735498
public function removeItem(Item $item)
    {
        if ($this->items->contains($item)) {
            $this->items->removeElement($item);
            $item->removeGenre($this);
        }

        return $this;
    }
1089957
public function remove($item)
    {
        $key = $item instanceof Item ? $item->name : $item;

        if ($this->has($key)) {
            $this->forget($key);
            return true;
        }

        return false;
    }
585688
public function addItem($item)
	{
		if( ! $item instanceof Model )
		{
			$item = new $this->defaultModel($item);
		}

		$this->data[] = $item;
	}
719430
public function push($item)
	{
		$full_class_name = $this->getFullClassName();

		if (is_array($item)) {
			array_push($this->items, new $full_class_name($item));
		}
		elseif ($item instanceof $full_class_name) {
			array_push($this->items, $item);
		}
	}