components/MenuHelper.php
private static function requiredParent($assigned, &$menus)
    {
        $l = count($assigned);
        for ($i = 0; $i < $l; $i++) {
            $id = $assigned[$i];
            $parent_id = $menus[$id]['parent'];
            if ($parent_id !== null && !in_array($parent_id, $assigned)) {
                $assigned[$l++] = $parent_id;
            }
        }

        return $assigned;
    }
private static function requiredParent($assigned, &$menus)
    {
        $l = count($assigned);
        for ($i = 0; $i < $l; $i++) {
            $id = $assigned[$i];
            $parent_id = $menus[$id]['parent'];
            if ($parent_id !== null && !in_array($parent_id, $assigned)) {
                $assigned[$l++] = $parent_id;
            }
        }

        return $assigned;
    }
private static function requiredParent ( $ assigned , & $ menus ) { $ l = count ( $ assigned ) ; for ( $ i = 0 ; $ i < $ l ; $ i ++ ) { $ id = $ assigned [ $ i ] ; $ parent_id = $ menus [ $ id ] [ 'parent' ] ; if ( $ parent_id !== null && ! in_array ( $ parent_id , $ assigned ) ) { $ assigned [ $ l ++ ] = $ parent_id ; } } return $ assigned ; }
Ensure all item menu has parent.
@param  array $assigned
@param  array $menus
@return array
Ensure all item menu has parent .