コード例 #1
0
 /**
  * Get children
  * @param boolean $all
  *
  * @return ArrayCollection|ChildrenCollection
  */
 public function getChildren($all = false)
 {
     if ($all) {
         $children = $this->children;
     } else {
         $children = array();
         if ($this->getLabel()) {
             $home = new MenuNodeBase($this->name . '_home');
             $home->setLabel($this->getLabel())->setAttributes($this->getAttributes())->setLinkAttributes($this->getLinkAttributes())->setUri('#' . $this->name);
             $children[] = $home;
         }
         foreach ($this->children as $child) {
             if ($child instanceof OnePageSection || $child instanceof NodeInterface) {
                 $children[] = $child;
             }
         }
     }
     return $children;
 }
コード例 #2
0
ファイル: MenuNode.php プロジェクト: viral810/ngSimpleCMS
 /**
  * {@inheritDoc}
  */
 public function getOptions()
 {
     $options = parent::getOptions();
     return array_merge($options, array('linkType' => $this->linkType, 'content' => $this->getContent()));
 }