function EntityField::clickSortable

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/field/EntityField.php \Drupal\views\Plugin\views\field\EntityField::clickSortable()
  2. 8.9.x core/modules/views/src/Plugin/views/field/EntityField.php \Drupal\views\Plugin\views\field\EntityField::clickSortable()
  3. 10 core/modules/views/src/Plugin/views/field/EntityField.php \Drupal\views\Plugin\views\field\EntityField::clickSortable()

Overrides FieldPluginBase::clickSortable

File

core/modules/views/src/Plugin/views/field/EntityField.php, line 313

Class

EntityField
A field that displays entity field data.

Namespace

Drupal\views\Plugin\views\field

Code

public function clickSortable() {
    // 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;
    }
    // If field definition is set, use that.
    if (isset($this->definition['click sortable'])) {
        return (bool) $this->definition['click sortable'];
    }
    // Default to true.
    return TRUE;
}

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