private function applyMultiSort(array $data, array $sortArguments)
    {
        $args = [];
        foreach ($sortArguments as $values) {
            $remain = count($values) % 3;
            if ($remain != 0) {
                throw new \InvalidArgumentException(
                    'The parameter count for each sortArgument has to be three. Given count of: ' . count($values)
                );
            }
            $args[] = $values[0]; // column value
            $args[] = $values[1]; // sort direction
            $args[] = $values[2]; // sort type
        }

        $args[] = $data;

        //possible 5.3.3 fix?
        $sortArgs = [];
        foreach ($args as $key => &$value) {
            $sortArgs[$key] = &$value;
        }

        call_user_func_array('array_multisort', $sortArgs);

        return end($args);
    }
private function applyMultiSort(array $data, array $sortArguments)
    {
        $args = [];
        foreach ($sortArguments as $values) {
            $remain = count($values) % 3;
            if ($remain != 0) {
                throw new \InvalidArgumentException(
                    'The parameter count for each sortArgument has to be three. Given count of: ' . count($values)
                );
            }
            $args[] = $values[0]; // column value
            $args[] = $values[1]; // sort direction
            $args[] = $values[2]; // sort type
        }

        $args[] = $data;

        //possible 5.3.3 fix?
        $sortArgs = [];
        foreach ($args as $key => &$value) {
            $sortArgs[$key] = &$value;
        }

        call_user_func_array('array_multisort', $sortArgs);

        return end($args);
    }
private function applyMultiSort ( array $ data , array $ sortArguments ) { $ args = [ ] ; foreach ( $ sortArguments as $ values ) { $ remain = count ( $ values ) % 3 ; if ( $ remain != 0 ) { throw new \ InvalidArgumentException ( 'The parameter count for each sortArgument has to be three. Given count of: ' . count ( $ values ) ) ; } $ args [ ] = $ values [ 0 ] ; // column value $ args [ ] = $ values [ 1 ] ; // sort direction $ args [ ] = $ values [ 2 ] ; // sort type } $ args [ ] = $ data ; //possible 5.3.3 fix? $ sortArgs = [ ] ; foreach ( $ args as $ key => & $ value ) { $ sortArgs [ $ key ] = & $ value ; } call_user_func_array ( 'array_multisort' , $ sortArgs ) ; return end ( $ args ) ; }
Multisort an array.

@param array $data
@param array $sortArguments

@throws \InvalidArgumentException

@return array|false
Multisort an array .