function EntityArgument::titleQuery
Same name in other branches
- 10 core/modules/views/src/Plugin/views/argument/EntityArgument.php \Drupal\views\Plugin\views\argument\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\argumentCode
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.