/** * 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(); }
/** * 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; }