public function Field::clickSortable

Determine if this field is click sortable.

Overrides FieldPluginBase::clickSortable

File

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

Class

Field
A field that displays fieldapi fields.

Namespace

Drupal\field\Plugin\views\field

Code

public function clickSortable() {

  // Not click sortable in any case.
  if (empty($this->definition['click sortable'])) {
    return FALSE;
  }

  // A field is not click sortable if it's a multiple field with
  // "group multiple values" checked, since a click sort in that case would
  // add a join to the field table, which would produce unwanted duplicates.
  if ($this->multiple && $this->options['group_rows']) {
    return FALSE;
  }
  return TRUE;
}