Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IndexTid.php

function IndexTid::titleQuery

Overrides ManyToOne::titleQuery

File

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

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal