Esempio n. 1
0
 /**
  * @param array $pages
  *
  * @return $this
  */
 public function addPages(array $pages)
 {
     foreach ($pages as $page) {
         if (isset($page['children'])) {
             $section = $this->navigation->findSectionOrCreate($page['name'], $this);
             $section->setAttribute(array_except($page, 'children'));
             if (count($page['children']) > 0) {
                 $section->addPages($page['children']);
             }
         } else {
             $this->addPage(new Page($page));
         }
     }
     return $this;
 }