Example #1
0
 /**
  * Get the active node in this tree, if any.
  *
  * @return  RMenuNode|boolean  The active node or false if no active nodes.
  */
 public function getActiveNode()
 {
     if ($this->rootNode->isActive()) {
         return $this->rootNode;
     }
     return $this->rootNode->getActiveChild();
 }
Example #2
0
 /**
  * Add a child to this node.
  *
  * @param   RMenuNode  $child  The child.
  *
  * @return  RMenuNode  This method is chainable.
  */
 public function addChild(RMenuNode $child)
 {
     // Add the children.
     $this->children[$child->getName()] = $child;
     // Set this node as parent.
     $child->setParent($this);
     return $this;
 }