public function FieldPluginBase::clickSort

Called to determine what to tell the clicksorter.

1 method overrides FieldPluginBase::clickSort()
Field::clickSort in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Called to determine what to tell the clicksorter.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php, line 168
Definition of Drupal\views\Plugin\views\field\FieldPluginBase.

Class

FieldPluginBase
Base field handler that has no options and renders an unformatted field.

Namespace

Drupal\views\Plugin\views\field

Code

public function clickSort($order) {
  if (isset($this->field_alias)) {

    // Since fields should always have themselves already added, just
    // add a sort on the field.
    $params = $this->options['group_type'] != 'group' ? array(
      'function' => $this->options['group_type'],
    ) : array();
    $this->query
      ->addOrderBy(NULL, NULL, $order, $this->field_alias, $params);
  }
}