You are here

function hosting_task_handler_sort_default::query in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 task/includes/views/handlers/hosting_task_handler_sort_default.inc \hosting_task_handler_sort_default::query()

Called to add the sort to a query.

Overrides views_handler_sort::query

File

task/includes/views/handlers/hosting_task_handler_sort_default.inc, line 7

Class

hosting_task_handler_sort_default
Handle the default hosting task sort order.

Code

function query() {
  $this->query
    ->add_orderby(NULL, "FIELD(task_status, 0, -1, '>0')", 'ASC', '_' . $this->field);
  $this->query
    ->add_orderby(NULL, 'executed', 'DESC', '_' . $this->field);
  $this->query
    ->add_orderby(NULL, 'node.created', 'DESC', '_' . $this->field);
}