Backend\Modules\Pages\Engine\CacheBuilder::getOrder PHP Метод

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

Get the order
protected getOrder ( array $navigation, string $type = 'page', integer $parentId, array $order = [] ) : array
$navigation array The navigation array.
$type string The type of navigation.
$parentId integer The Id to start from.
$order array The array to hold the order.
Результат array
    protected function getOrder($navigation, $type = 'page', $parentId = 0, $order = array())
    {
        // loop alle items for the type and parent
        foreach ($navigation[$type][$parentId] as $id => $page) {
            // add to array
            $order[$id] = $page['full_url'];
            // children of root/footer/meta-pages are stored under the page type
            if (($type == 'root' || $type == 'footer' || $type == 'meta') && isset($navigation['page'][$id])) {
                // process subpages
                $order = $this->getOrder($navigation, 'page', $id, $order);
            } elseif (isset($navigation[$type][$id])) {
                // process subpages
                $order = $this->getOrder($navigation, $type, $id, $order);
            }
        }
        // return
        return $order;
    }