Esempio n. 1
0
 /**
  * Get top level NavigationInterface instance
  *
  * @return NavigationInterface|null
  */
 public function getNavigation()
 {
     if ($this->_parentContainer instanceof NavigationInterface) {
         return $this->_parentContainer;
     } elseif ($this->_parentContainer instanceof Item) {
         return $this->_parentContainer->getNavigation();
     }
     return null;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function addElement(NavigationInterface $element)
 {
     $id = $element->getId();
     if (isset($this->elements[$id])) {
         throw new \LogicException(sprintf('Navigation with ID: "%s" already exists', $id));
     }
     $this->elements[$id] = $element;
     return $this;
 }