Returns the children for every parent.
protected getChildrenList ( ) : array | ||
return | array | the children list. Each array key is a parent item name, and the corresponding array value is a list of child item names. |
/** * @inheritdoc */ protected function getChildrenList() { if ($this->_childrenList === null) { $this->_childrenList = parent::getChildrenList(); } return $this->_childrenList; }
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; }