public function Id::titleQuery in Recipe 8.2
Override the behavior of title(). Get the title of the node.
Overrides NumericArgument::titleQuery
File
- modules/
ingredient/ src/ Plugin/ views/ argument/ Id.php, line 18
Class
- Id
- Argument handler to accept an ingredient id.
Namespace
Drupal\ingredient\Plugin\views\argumentCode
public function titleQuery() {
$titles = [];
$ingredients = Ingredient::loadMultiple($this->value);
foreach ($ingredients as $ingredient) {
$titles[] = $ingredient
->label();
}
return $titles;
}