Exemple #1
0
 public function addElement(AppLib_Menu_Element $element)
 {
     if (!$element->isValidForAdd()) {
         throw new AppLib_Menu_Exception(implode(', ', $element->getValidNeeds()) . ' should not be empty.');
     }
     if (empty($this->_elements)) {
         $this->_elements = array();
     }
     $this->_elements[] = $element;
     $this->_countElements++;
     return $this;
 }
Exemple #2
0
 public function addChild(AppLib_Menu_Element $elm)
 {
     if (!$elm->isValidForAdd()) {
         throw new AppLib_Menu_Exception(implode(', ', array_keys($elm->getValidNeeds())) . ' should not be empty.');
     }
     if (empty($this->_children)) {
         $this->_children = array();
     }
     $this->_children[] = $elm;
     return $this;
 }