Baum\Node::shiftSiblingsForRestore PHP 메소드

shiftSiblingsForRestore() 공개 메소드

"Makes room" for the the current node between its siblings.
public shiftSiblingsForRestore ( ) : void
리턴 void
    public function shiftSiblingsForRestore()
    {
        if (is_null($this->getRight()) || is_null($this->getLeft())) {
            return;
        }
        $self = $this;
        $this->getConnection()->transaction(function () use($self) {
            $lftCol = $self->getLeftColumnName();
            $rgtCol = $self->getRightColumnName();
            $lft = $self->getLeft();
            $rgt = $self->getRight();
            $diff = $rgt - $lft + 1;
            $self->newNestedSetQuery()->where($lftCol, '>=', $lft)->increment($lftCol, $diff);
            $self->newNestedSetQuery()->where($rgtCol, '>=', $lft)->increment($rgtCol, $diff);
        });
    }