You are here

public function SimilarTermsSort::query in Similar By Terms 8

Add orderBy.

Overrides SortPluginBase::query

File

src/Plugin/views/sort/SimilarTermsSort.php, line 28

Class

SimilarTermsSort
Handler which sort by the similarity.

Namespace

Drupal\similarterms\Plugin\views\sort

Code

public function query() {
  $this
    ->ensureMyTable();
  $this->query
    ->addOrderBy($this->tableAlias, 'nid', $this->options['order'], NULL, [
    'function' => 'count',
  ]);
}