Jackalope\ObjectManager::removeItem PHP Method

removeItem() public method

If this is a node, sets all cached items below this node to deleted as well. If property is set, the path denotes the node containing the property, otherwise the node at path is removed.
See also: Item::remove()
public removeItem ( string $absPath, PHPCR\PropertyInterface $property = null )
$absPath string The absolute path to the node to be removed, including the node name.
$property PHPCR\PropertyInterface optional, property instance to delete from the given node path. If set, absPath is the path to the node containing this property.
    public function removeItem($absPath, PropertyInterface $property = null)
    {
        if (!$this->transport instanceof WritingInterface) {
            throw new UnsupportedRepositoryOperationException('Transport does not support writing');
        }
        // the object is always cached as invocation flow goes through Item::remove() without exception
        if (!isset($this->objectsByPath['Node'][$absPath])) {
            throw new RepositoryException("Internal error: Item not found in local cache at {$absPath}");
        }
        if ($property) {
            $absPath = PathHelper::absolutizePath($property->getName(), $absPath);
            $this->performPropertyRemove($absPath, $property);
        } else {
            $node = $this->objectsByPath['Node'][$absPath];
            $this->performNodeRemove($absPath, $node);
            $this->cascadeDelete($absPath);
        }
    }