function ListString::summary_name

Provides the name to use for the summary. By default this is just the name field.

Parameters

$data: The query results for the row.

Overrides String::summary_name

File

drupal/core/modules/field/lib/Drupal/field/Plugin/views/argument/ListString.php, line 64
Definition of Drupal\field\Plugin\views\argument\ListString.

Class

ListString
Argument handler for list field to show the human readable name in the summary.

Namespace

Drupal\field\Plugin\views\argument

Code

function summary_name($data) {
  $value = $data->{$this->name_alias};

  // If the list element has a human readable name show it,
  if (isset($this->allowed_values[$value]) && !empty($this->options['summary']['human'])) {
    return $this
      ->caseTransform(field_filter_xss($this->allowed_values[$value]), $this->options['case']);
  }
  else {
    return $this
      ->caseTransform(check_plain($value), $this->options['case']);
  }
}