public function addItemInstance(Nodes\NodeInterface $item, $location = null)
	{
		$location = (int) $location;

		$this->items[$location][] = $item;

		if ($id = $item->getId()) {
			$this->ids[$id] = $item;
		}

		return $item;
	}
public function addItemInstance(Nodes\NodeInterface $item, $location = null)
	{
		$location = (int) $location;

		$this->items[$location][] = $item;

		if ($id = $item->getId()) {
			$this->ids[$id] = $item;
		}

		return $item;
	}
public function addItemInstance ( Nodes \ NodeInterface $ item , $ location = null ) { $ location = ( int ) $ location ; $ this -> items [ $ location ] [ ] = $ item ; if ( $ id = $ item -> getId ( ) ) { $ this -> ids [ $ id ] = $ item ; } return $ item ; }
Add a new node instance to the collection.

@param  Nodes\NodeInterface $item
@param  int           $location

@return Nodes\NodeInterface $item
Add a new node instance to the collection .