Jackalope\Node::unsetChildNode PHP Метод

unsetChildNode() публичный Метод

Removes the reference in the internal node storage
public unsetChildNode ( string $name, boolean $check )
$name string the name of the child node to unset
$check boolean whether a state check should be done - set to false during internal update operations
    public function unsetChildNode($name, $check)
    {
        if ($check) {
            $this->checkState();
        }
        $key = array_search($name, $this->nodes);
        if ($key === false) {
            if (!$check) {
                // inside a refresh operation
                return;
            }
            throw new ItemNotFoundException("Could not remove child node because it's already gone");
        }
        unset($this->nodes[$key]);
        if (null !== $this->originalNodesOrder) {
            $this->originalNodesOrder = array_flip($this->originalNodesOrder);
            unset($this->originalNodesOrder[$name]);
            $this->originalNodesOrder = array_flip($this->originalNodesOrder);
        }
    }