Jackalope\ObjectManager::addNode PHP Method

addNode() public method

WRITE: add a node at the specified path. Schedules an add operation for the next save() and caches the node.
public addNode ( string $absPath, PHPCR\NodeInterface $node )
$absPath string the path to the node or property, including the item name
$node PHPCR\NodeInterface The item instance that is added.
    public function addNode($absPath, NodeInterface $node)
    {
        if (!$this->transport instanceof WritingInterface) {
            throw new UnsupportedRepositoryOperationException('Transport does not support writing');
        }
        if (isset($this->objectsByPath['Node'][$absPath])) {
            throw new ItemExistsException($absPath);
            //FIXME: same-name-siblings...
        }
        $this->objectsByPath['Node'][$absPath] = $node;
        // a new item never has a uuid, no need to add to objectsByUuid
        $operation = new AddNodeOperation($absPath, $node);
        $this->nodesAdd[$absPath] = $operation;
        $this->operationsLog[] = $operation;
    }