getChildrenList() защищенный Метод

Returns the children for every parent.
protected getChildrenList ( ) : array
Результат array the children list. Each array key is a parent item name, and the corresponding array value is a list of child item names.
Пример #1
0
 /**
  * @inheritdoc
  */
 protected function getChildrenList()
 {
     if ($this->_childrenList === null) {
         $this->_childrenList = parent::getChildrenList();
     }
     return $this->_childrenList;
 }
Пример #2
0
 private function getMenu()
 {
     $data = parent::getChildrenList();
     $menu = [];
     foreach ($data as $k => $v) {
         if (strpos($k, 'r-') === 0) {
             continue;
         }
         $menu[$v[0]][] = $k;
     }
     foreach ($menu as $k => $v) {
         $order = $this->menu_order[$k];
         usort($v, function ($a, $b) use($order) {
             return array_search($a, $order) > array_search($b, $order) ? 1 : -1;
         });
         $menu[$k] = $v;
     }
     $order = array_keys($this->menu_order);
     uksort($menu, function ($a, $b) use($order) {
         return array_search($a, $order) > array_search($b, $order) ? 1 : -1;
     });
     return $menu;
 }