You are here

class apachesolr_views_handler_sort in Apache Solr Views 6

Same name and namespace in other branches
  1. 7 handlers/apachesolr_views_handler_sort.inc \apachesolr_views_handler_sort

Class for sorting for a field.

Hierarchy

Expanded class hierarchy of apachesolr_views_handler_sort

1 string reference to 'apachesolr_views_handler_sort'
apachesolr_views_views_data in ./apachesolr_views.views.inc
Implementation of hook_views_data().

File

handlers/apachesolr_views_handler_sort.inc, line 7

View source
class apachesolr_views_handler_sort extends views_handler_sort {

  /**
   * Places the sort into the search parameters.
   */
  public function query() {

    /* These fields have a special "*_sort" field for sorting: */
    $special_sort_fields = array(
      'name' => 'sort_name',
      'title' => 'sort_title',
    );
    $order = strtolower($this->options['order']);
    if (empty($special_sort_fields[$this->real_field])) {
      $this->query
        ->add_sort($this->real_field, $order);
    }
    else {
      $this->query
        ->add_sort($special_sort_fields[$this->real_field], $order);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
apachesolr_views_handler_sort::query public function Places the sort into the search parameters.