Baum\Node::setDepth PHP Метод

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

Sets the depth attribute.
public setDepth ( ) : Node
Результат Node
    public function setDepth()
    {
        $self = $this;
        $this->getConnection()->transaction(function () use($self) {
            $self->reload();
            $level = $self->getLevel();
            $self->newNestedSetQuery()->where($self->getKeyName(), '=', $self->getKey())->update([$self->getDepthColumnName() => $level]);
            $self->setAttribute($self->getDepthColumnName(), $level);
        });
        return $this;
    }

Usage Example

Пример #1
0
 public function setDepth()
 {
     $this->saveTranslations();
     return parent::setDepth();
 }