protected function getSortOrder(Request $request)
    {
        $sort = array();

        $order = $request->query->get('order', array());

        $columns = $this->getSortColumns($request);

        foreach ($order as $setting) {
            $index = $setting['column'];

            if (array_key_exists($index, $columns)) {
                $column = $columns[$index];

                if (!is_array($column)) {
                    $column = array($column);
                }

                foreach ($column as $c) {
                    $sort[] = array(
                        $c,
                        $setting['dir'],
                    );
                }
            }
        }

        // Default sort order
        if (empty($sort)) {
            $sort = $this->getDefaultSortOrder($request);
        }

        return $sort;
    }
protected function getSortOrder(Request $request)
    {
        $sort = array();

        $order = $request->query->get('order', array());

        $columns = $this->getSortColumns($request);

        foreach ($order as $setting) {
            $index = $setting['column'];

            if (array_key_exists($index, $columns)) {
                $column = $columns[$index];

                if (!is_array($column)) {
                    $column = array($column);
                }

                foreach ($column as $c) {
                    $sort[] = array(
                        $c,
                        $setting['dir'],
                    );
                }
            }
        }

        // Default sort order
        if (empty($sort)) {
            $sort = $this->getDefaultSortOrder($request);
        }

        return $sort;
    }
protected function getSortOrder ( Request $ request ) { $ sort = array ( ) ; $ order = $ request -> query -> get ( 'order' , array ( ) ) ; $ columns = $ this -> getSortColumns ( $ request ) ; foreach ( $ order as $ setting ) { $ index = $ setting [ 'column' ] ; if ( array_key_exists ( $ index , $ columns ) ) { $ column = $ columns [ $ index ] ; if ( ! is_array ( $ column ) ) { $ column = array ( $ column ) ; } foreach ( $ column as $ c ) { $ sort [ ] = array ( $ c , $ setting [ 'dir' ] , ) ; } } } // Default sort order if ( empty ( $ sort ) ) { $ sort = $ this -> getDefaultSortOrder ( $ request ) ; } return $ sort ; }
Computes the sort order. This method should be considered final for
all practical purposes.

@param Request $request the current request
@return Array the sort order
Computes the sort order . This method should be considered final for all practical purposes .