You are here

public function StringListField::summaryName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/options/src/Plugin/views/argument/StringListField.php \Drupal\options\Plugin\views\argument\StringListField::summaryName()

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 StringArgument::summaryName

File

core/modules/options/src/Plugin/views/argument/StringListField.php, line 79
Contains \Drupal\options\Plugin\views\argument\StringListField.

Class

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

Namespace

Drupal\options\Plugin\views\argument

Code

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

  // If the list element has a human readable name show it.
  if (isset($this->allowedValues[$value]) && !empty($this->options['summary']['human'])) {
    $value = $this->allowedValues[$value];
  }
  return FieldFilteredMarkup::create($this
    ->caseTransform($value, $this->options['case']));
}