Ejemplo n.º 1
0
 /**
  * @ToDo
  * Добавляет вложенный элемент
  */
 public function addItem($id, $url, $options = array())
 {
     $item = new Item($id, $url, $options);
     // Если такой пункт уже есть
     if ($this->getSection()->find($item->getId())) {
         throw new NavigationException('Id ' . $item->getId() . ' already exists');
     }
     if ($item !== null && $item !== false) {
         $item->setSectionName($this->getSectionName());
         $this->_subItems[$id] = $item;
     }
     return $this->_subItems;
 }