Deletes node and it's descendants.

@param  \BackBee\NestedNode\AbstractNestedNode $node
@return boolean                         TRUE on success, FALSE if try to delete a root
179684
public function delete(AbstractNestedNode $node)
    {
        if (true === $node->isRoot()) {
            return false;
        }

        $this->createQueryBuilder('n')
                ->set('n._parent', 'NULL')
                ->andIsDescendantOf($node)
                ->update()
                ->getQuery()
                ->execute();

        $this->createQueryBuilder('n')
                ->delete()
                ->andIsDescendantOf($node)
                ->getQuery()
                ->execute();

        $this->shiftRlValues($node->getParent(), $node->getLeftnode(), -$node->getWeight());

        return true;
    }
179992
public function removeNode( $node)
	{
		foreach( $this->getNodes() as $_node )
		{
			if( $this->isEdge( $_node, $node ) )
				$this->removeEdge( $_node, $node );				//  remove incoming Edges
			if( $this->isEdge( $node, $_node ) )
				$this->removeEdge( $node, $_node );				//  remove outgoing Edges
		}
		$this->nodeSet->removeNode( $node );												//  remove Node
	}
162065
public function addNode(AbstractNode $node) {
        $node->parent           = $this;
        $this->index[$node->id] = count($this->nodes);
        $this->nodes[]          = $node;
        return $this;
    }
813582
public boolean remove(Tree<T> node) {
    return getChild(node)
        .map(function(n -> n.parent = null))
        .map(children::remove)
        .orElse(false);
  }
807223
public function remove($node)
    {
        $nodeIndex = null;
        $nodeString = serialize($node);

        // Search for the node in the node list
        foreach (array_keys($this->_nodes) as $i) {
            if ($this->_nodes[$i]['n'] === $node) {
                $nodeIndex = $i;
                break;
            }
        }

        if (is_null($nodeIndex)) {
            throw new InvalidArgumentException('Node was not in the hash');
        }

        // Remove all points from the circle
        $numberOfReplicas = (int)($this->_nodes[$nodeIndex]['w'] * $this->_numberOfReplicas);
        for ($i = 0; $i < $numberOfReplicas; $i++) {
            unset($this->_circle[$this->hash($nodeString . $i)]);
        }
        $this->_updateCircle();

        // Unset the node from the node list
        unset($this->_nodes[$nodeIndex]);
        $this->_nodeCount--;
    }
551708
public function apply(AbstractNode $node): void
    {
        if (!$this->isFacade($node)) {
            return;
        }

        $this->applyRule($node);
    }
641858
public function removeNode( $node )
	{
		foreach( $this->getNodes() as $_node )
			$this->removeEdge( $_node, $node );									//  remove all Edges of Node
		$this->nodeSet->removeNode( $node );									//  remove Node
	}
1156257
public function leaveNode(Node $node)
    {
        if ($node instanceof Class_) {
            $count = \count($this->abstractMethods);
            if ($count > 0 && !$node->isAbstract()) {
                $msg = \sprintf(
                    'Class %s contains %d abstract method%s must therefore be declared abstract or implement the remaining methods (%s)',
                    $node->name,
                    $count,
                    ($count === 1) ? '' : 's',
                    \implode(', ', $this->abstractMethods)
                );
                throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
            }
        }
    }
565925
protected function _removeFromTree($node)
    {
        $config = $this->getConfig();
        $left = $node->get($config['left']);
        $right = $node->get($config['right']);
        $parent = $node->get($config['parent']);

        $node->set($config['parent'], null);

        if ($right - $left == 1) {
            return $this->_table->save($node);
        }

        $primary = $this->_getPrimaryKey();
        $this->_table->updateAll(
            [$config['parent'] => $parent],
            [$config['parent'] => $node->get($primary)]
        );
        $this->_sync(1, '-', 'BETWEEN ' . ($left + 1) . ' AND ' . ($right - 1));
        $this->_sync(2, '-', "> {$right}");
        $edge = $this->_getMax();
        $node->set($config['left'], $edge + 1);
        $node->set($config['right'], $edge + 2);
        $fields = [$config['parent'], $config['left'], $config['right']];

        $this->_table->updateAll($node->extract($fields), [$primary => $node->get($primary)]);

        foreach ($fields as $field) {
            $node->setDirty($field, false);
        }

        return $node;
    }
1169609
public function apply(AbstractNode $node)
    {
        if (!$this->isFactory($node)) {
            return;
        }

        foreach ($node->getMethods() as $method) {
            $this->applyRule($method);
        }
    }
860159
function remove( ParseNode $Node ){
		foreach( $this->children as $i => $Child ){
			if( $Child->idx === $Node->idx ){
				return $this->remove_at( $i );
			}
		}
	}
935515
private function replaceNode(Node $node)
    {
        //Looking for parent block call
        if (!empty($inner = $node->findNode($this->name))) {
            //This construction allows child block use parent content
            $inner->nodes = $this->nodes;
        }

        $this->nodes = $node->nodes;
    }
121499
private function hasNotAllowedChildren(MethodNode $node)
    {
        $children = $node->findChildrenOfType('ScopeStatement');

        $allowedChildren = explode(
            $this->getStringProperty('delimiter'),
            $this->getStringProperty('allowedChildren')
        );

        /** @var AbstractNode $child */
        foreach ($children as $child) {
            if (true === in_array($child->getImage(), $allowedChildren) || true === $this->isChildOfTry($child)) {
                continue;
            }

            return true;
        }

        return false;
    }
585454
public function leaveNode(Node $node)
    {
        switch (get_class($node)) {
            case Namespace_::class:
            case Class_::class:
            case ClassMethod::class:
            case Trait_::class:
            case PropertyProperty::class:
            case ClassConst::class:
            case Const_::class:
            case Interface_::class:
            case Function_::class:
                if (!$this->parts->isEmpty()) {
                    $this->parts->pop();
                }
                break;
        }
    }
1029496
protected function refreshExistingNode(AbstractNestedNode $node)
    {
        if (true === $this->_em->contains($node)) {
            $this->_em->refresh($node);
        } elseif (null === $node = $this->find($node->getUid())) {
            $this->_em->persist($node);
        }

        return $this;
    }
167780
public function delete(&$node, JsonPointerInterface $pointer)
    {
        $pathElements = $pointer->toArray();
        if (!$pathElements) {
            throw new InvalidPathException('Cannot delete root document');
        }
        $lastPath = array_pop($pathElements);
        $lastNode = & $this->getNodeReference($node, $pathElements);

        $accessor = $this->getAccessorForNode($lastNode, $pointer, $lastPath);
        $isAssocArray = $this->isAssociativeArray($lastNode);
        $accessor->delete($lastNode, $lastPath);

        if (!$isAssocArray) {
            $lastNode = array_values($lastNode);
        }
    }
572403
public function delete(\DOMNode $node): self {
        $index = array_search($node, $this->nodes, true);

        if ($index !== false) {
            unset($this->nodes[$index]);
        }

        return $this;
    }