public static function normalizeMap($array)
    {
        $nested = array();

        foreach ((array) $array as $key=>$value) {
            if (is_numeric($key)) {
                $nested[$value] = array();
            } else {
                $nested[$key] = $value;
            }
        }

        return $nested;
    }
public static function normalizeMap($array)
    {
        $nested = array();

        foreach ((array) $array as $key=>$value) {
            if (is_numeric($key)) {
                $nested[$value] = array();
            } else {
                $nested[$key] = $value;
            }
        }

        return $nested;
    }
public static function normalizeMap ( $ array ) { $ nested = array ( ) ; foreach ( ( array ) $ array as $ key => $ value ) { if ( is_numeric ( $ key ) ) { $ nested [ $ value ] = array ( ) ; } else { $ nested [ $ key ] = $ value ; } } return $ nested ; }
Takes either a flat array of relationships or a nested key=>value array and returns
it as a nested format
@return array
Takes either a flat array of relationships or a nested key = > value array and returns it as a nested format