Example #1
0
 /**
  * {@inheritdoc}
  */
 public function getDepth()
 {
     if ($this->parent === null) {
         return 0;
     }
     return $this->parent->getDepth() + 1;
 }
Example #2
0
 public function setParent(NodeInterface $parent)
 {
     $this->parent = $parent;
     $this->setDepth($parent->getDepth() + 1);
 }