src/Baum/Node.php
public function setDepth() {
    $self = $this;

    $this->getConnection()->transaction(function() use ($self) {
      $self->reload();

      $level = $self->getLevel();

      $self->newNestedSetQuery()->where($self->getKeyName(), '=', $self->getKey())->update(array($self->getDepthColumnName() => $level));
      $self->setAttribute($self->getDepthColumnName(), $level);
    });

    return $this;
  }
public function setDepth() {
    $self = $this;

    $this->getConnection()->transaction(function() use ($self) {
      $self->reload();

      $level = $self->getLevel();

      $self->newNestedSetQuery()->where($self->getKeyName(), '=', $self->getKey())->update(array($self->getDepthColumnName() => $level));
      $self->setAttribute($self->getDepthColumnName(), $level);
    });

    return $this;
  }
Sets the depth attribute

@return \Baum\Node