protected function getModelSortCriteria()
    {
        $sort = $this->getActualSort();
        $info = $this->getModelInformation();

        // Sort by orderable strategy if we should and can
        if (    $info->list->orderable
            &&  $sort == $info->list->getOrderableColumn()
            &&  ($orderableStrategy = $this->getOrderableSortStrategy())
        ) {
            return $orderableStrategy;
        }

        // Otherwise, attempt to sort by any other list column
        if ( ! isset($info->list->columns[$sort])) {
            return false;
        }

        $strategy = $info->list->columns[$sort]->sort_strategy;
        $source   = $info->list->columns[$sort]->source ?: $sort;

        return new ModelOrderStrategy($strategy, $source, $this->getActualSortDirection());
    }
protected function getModelSortCriteria()
    {
        $sort = $this->getActualSort();
        $info = $this->getModelInformation();

        // Sort by orderable strategy if we should and can
        if (    $info->list->orderable
            &&  $sort == $info->list->getOrderableColumn()
            &&  ($orderableStrategy = $this->getOrderableSortStrategy())
        ) {
            return $orderableStrategy;
        }

        // Otherwise, attempt to sort by any other list column
        if ( ! isset($info->list->columns[$sort])) {
            return false;
        }

        $strategy = $info->list->columns[$sort]->sort_strategy;
        $source   = $info->list->columns[$sort]->source ?: $sort;

        return new ModelOrderStrategy($strategy, $source, $this->getActualSortDirection());
    }
protected function getModelSortCriteria ( ) { $ sort = $ this -> getActualSort ( ) ; $ info = $ this -> getModelInformation ( ) ; // Sort by orderable strategy if we should and can if ( $ info -> list -> orderable && $ sort == $ info -> list -> getOrderableColumn ( ) && ( $ orderableStrategy = $ this -> getOrderableSortStrategy ( ) ) ) { return $ orderableStrategy ; } // Otherwise, attempt to sort by any other list column if ( ! isset ( $ info -> list -> columns [ $ sort ] ) ) { return false ; } $ strategy = $ info -> list -> columns [ $ sort ] -> sort_strategy ; $ source = $ info -> list -> columns [ $ sort ] -> source ? : $ sort ; return new ModelOrderStrategy ( $ strategy , $ source , $ this -> getActualSortDirection ( ) ) ; }
Returns the active model sorting criteria to apply to the model repository.

@return ModelOrderStrategy|false
Returns the active model sorting criteria to apply to the model repository .