Beispiel #1
0
 /**
  * Add a child to this item
  *
  * If the child is active this item gets activated as well.
  *
  * @param   NavigationItem  $child
  *
  * @return  $this
  */
 public function addChild(NavigationItem $child)
 {
     $this->getChildren()->addItem($child->setParent($this));
     if ($child->getActive()) {
         $this->setActive();
     }
     return $this;
 }