You are here

similarterms_handler_sort_similar.inc in Similar By Terms 7.2

Same filename and directory in other branches
  1. 6.2 views/similarterms_handler_sort_similar.inc

File

views/similarterms_handler_sort_similar.inc
View source
<?php

/**
 * Handler which sorts the by the similarity.
 *
 * @ingroups views_sort_handlers
 */
class similarterms_handler_sort_similar extends views_handler_sort {
  function option_definition() {
    $options = parent::option_definition();
    $options['order'] = array(
      'default' => 'DESC',
    );
    return $options;
  }
  function query() {
    $this
      ->ensure_my_table();
    $this->query
      ->add_orderby($this->table_alias, 'nid', $this->options['order'], NULL, array(
      'function' => 'count',
    ));
  }

}

Classes

Namesort descending Description
similarterms_handler_sort_similar Handler which sorts the by the similarity.