You are here

public function NumberListField::summaryName in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/options/src/Plugin/views/argument/NumberListField.php \Drupal\options\Plugin\views\argument\NumberListField::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 ArgumentPluginBase::summaryName

File

core/modules/options/src/Plugin/views/argument/NumberListField.php, line 72

Class

NumberListField
Argument handler for list field to show the human readable name in the 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'])) {
    return FieldFilteredMarkup::create($this->allowedValues[$value]);
  }
  else {
    return $value;
  }
}