You are here

public function EntityField::clickSortable in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/EntityField.php \Drupal\views\Plugin\views\field\EntityField::clickSortable()

Determines if this field is click sortable.

Return value

bool The value of 'click sortable' from the plugin definition, this defaults to TRUE if not set.

Overrides FieldPluginBase::clickSortable

File

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

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;
}