You are here

public function views_sort_expression_handler::query in Views Sort Expression 7

Called to add the sort to a query.

Overrides views_handler_sort::query

File

views/views_sort_expression_handler.inc, line 53
Filter classes.

Class

views_sort_expression_handler
Generic views handler filter to add code to manipulate the query object.

Code

public function query() {
  if (!empty($this->options['expression'])) {
    $alias = $this->real_field . '_' . $this->position;
    $this->query
      ->add_orderby(NULL, $this->options['expression'], $this->options['order'], $alias);
  }
}