Exemplo n.º 1
0
 /**
  * @param \Baum\Node $node
  * @param array $items
  * @return array
  */
 protected function appendMenu($node, &$items)
 {
     $items[] = ['title' => $node->present()->indentedTitle(), 'id' => $node->id];
     if (count($node->children)) {
         foreach ($node->children as $child) {
             foreach ($child->getDescendantsAndSelf()->toHierarchy() as $menu) {
                 $this->appendMenu($menu, $items);
             }
         }
     }
 }