You are here

public function IndexTid::titleQuery in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php \Drupal\taxonomy\Plugin\views\argument\IndexTid::titleQuery()
  2. 9 core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php \Drupal\taxonomy\Plugin\views\argument\IndexTid::titleQuery()

File

core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php, line 17

Class

IndexTid
Allow taxonomy term ID(s) as argument.

Namespace

Drupal\taxonomy\Plugin\views\argument

Code

public function titleQuery() {
  $titles = [];
  $terms = Term::loadMultiple($this->value);
  foreach ($terms as $term) {
    $titles[] = \Drupal::service('entity.repository')
      ->getTranslationFromContext($term)
      ->label();
  }
  return $titles;
}