function NumberListField::summaryName

Same name in other branches
  1. 8.9.x core/modules/options/src/Plugin/views/argument/NumberListField.php \Drupal\options\Plugin\views\argument\NumberListField::summaryName()
  2. 10 core/modules/options/src/Plugin/views/argument/NumberListField.php \Drupal\options\Plugin\views\argument\NumberListField::summaryName()
  3. 11.x core/modules/options/src/Plugin/views/argument/NumberListField.php \Drupal\options\Plugin\views\argument\NumberListField::summaryName()

Overrides ArgumentPluginBase::summaryName

File

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

Class

NumberListField
Argument handler for list field to show 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;
    }
}

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