You are here

public function TaxonomyIndexTid::adminSummary in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::adminSummary()

Display the filter on the administrative summary

Overrides InOperator::adminSummary

File

core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php, line 382

Class

TaxonomyIndexTid
Filter by term id.

Namespace

Drupal\taxonomy\Plugin\views\filter

Code

public function adminSummary() {

  // set up $this->valueOptions for the parent summary
  $this->valueOptions = [];
  if ($this->value) {
    $this->value = array_filter($this->value);
    $terms = Term::loadMultiple($this->value);
    foreach ($terms as $term) {
      $this->valueOptions[$term
        ->id()] = \Drupal::service('entity.repository')
        ->getTranslationFromContext($term)
        ->label();
    }
  }
  return parent::adminSummary();
}