Newscoop\Controller\Action\Helper\Datatable\Adapter\Theme::sort PHP Method

sort() public method

handle sorting parameters
public sort ( array $p_params )
$p_params array
    public function sort(array $p_params)
    {
        $search = $this->getSearchObject();
        foreach ($p_params as $k => $v) {
            switch ($k) {
                case 1:
                case 2:
                    $colName = 'NAME';
                    break;
                case 3:
                    $colName = 'MINOR_NEWSCOOP_VERSION';
                    break;
                default:
                    continue 2;
            }
            $sortMethod = $v == 'asc' ? 'orderAscending' : 'orderDescending';
            $search->{$colName}->{$sortMethod}();
        }
    }