Baum\Node::restoreDescendants PHP Method

restoreDescendants() public method

Restores all of the current node's descendants.
public restoreDescendants ( ) : void
return void
    public function restoreDescendants()
    {
        if (is_null($this->getRight()) || is_null($this->getLeft())) {
            return;
        }
        $self = $this;
        $this->getConnection()->transaction(function () use($self) {
            $self->newNestedSetQuery()->withTrashed()->where($self->getLeftColumnName(), '>', $self->getLeft())->where($self->getRightColumnName(), '<', $self->getRight())->update([$self->getDeletedAtColumn() => null, $self->getUpdatedAtColumn() => $self->{$self->getUpdatedAtColumn()}]);
        });
    }