You are here

public function TaxonomyIndexMachineName::adminSummary in Taxonomy Machine Name 8

Display the filter on the administrative summary

Overrides InOperator::adminSummary

File

src/Plugin/views/filter/TaxonomyIndexMachineName.php, line 394

Class

TaxonomyIndexMachineName
Filter by term id.

Namespace

Drupal\taxonomy_machine_name\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
        ->get('machine_name')
        ->get(0)->value] = \Drupal::service('entity.repository')
        ->getTranslationFromContext($term)
        ->label();
    }
  }
  return parent::adminSummary();
}