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

Breadcrumb

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

function EntityArgument::titleQuery

Overrides NumericArgument::titleQuery

File

core/modules/views/src/Plugin/views/argument/EntityArgument.php, line 53

Class

EntityArgument
Argument handler to accept an entity ID value.

Namespace

Drupal\views\Plugin\views\argument

Code

public function titleQuery() {
    $titles = [];
    $entities = $this->entityTypeManager
        ->getStorage($this->definition['entity_type'])
        ->loadMultiple($this->value);
    foreach ($entities as $entity) {
        $titles[$entity->id()] = $this->entityRepository
            ->getTranslationFromContext($entity)
            ->label();
    }
    return $titles;
}

API Navigation

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