IndexTid.php in Drupal 10
File
core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php
View source
<?php
namespace Drupal\taxonomy\Plugin\views\argument;
use Drupal\taxonomy\Entity\Term;
use Drupal\views\Plugin\views\argument\ManyToOne;
class IndexTid extends ManyToOne {
public function titleQuery() {
$titles = [];
$terms = Term::loadMultiple($this->value);
foreach ($terms as $term) {
$titles[] = \Drupal::service('entity.repository')
->getTranslationFromContext($term)
->label();
}
return $titles;
}
}
Classes
Name |
Description |
IndexTid |
Allow taxonomy term ID(s) as argument. |