function TaxonomyIndexTid::adminSummary

Same name and namespace in other branches
  1. 8.9.x core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::adminSummary()
  2. 10 core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::adminSummary()
  3. 11.x core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::adminSummary()

Overrides InOperator::adminSummary

File

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

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();
}

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