/** * Delete the node. All children will be deleted too * * @param \BeeTree\Contracts\Node $node * @return self **/ public function remove(Node $node) { // Collect the parentId to correct the positions of its old ancestors $parentId = $node->getParentId(); $position = $node->getPosition(); $this->performRemove($node); if ($parentId) { $this->decrementOrderAfter($parentId, $position); } return $this; }