function SortPluginBase::query

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::query()
  2. 8.9.x core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::query()
  3. 11.x core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::query()

Called to add the sort to a query.

Overrides HandlerBase::query

6 methods override SortPluginBase::query()
Date::query in core/modules/views/src/Plugin/views/sort/Date.php
Called to add the sort to a query.
GroupByNumeric::query in core/modules/views/src/Plugin/views/sort/GroupByNumeric.php
Called to add the field to a query.
Random::query in core/modules/views/src/Plugin/views/sort/Random.php
Called to add the sort to a query.
Score::query in core/modules/search/src/Plugin/views/sort/Score.php
Called to add the sort to a query.
StatisticsLastCommentName::query in core/modules/comment/src/Plugin/views/sort/StatisticsLastCommentName.php
Called to add the sort to a query.

... See full list

File

core/modules/views/src/Plugin/views/sort/SortPluginBase.php, line 38

Class

SortPluginBase
Base sort handler that has no options and performs a simple sort.

Namespace

Drupal\views\Plugin\views\sort

Code

public function query() {
    $this->ensureMyTable();
    // Add the field.
    $this->query
        ->addOrderBy($this->tableAlias, $this->realField, $this->options['order']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.