public function EntityIndex::getDerivativeDefinitions in Services 8.4
Same name and namespace in other branches
- 9.0.x src/Plugin/Deriver/EntityIndex.php \Drupal\services\Plugin\Deriver\EntityIndex::getDerivativeDefinitions()
Gets the definition of all derivatives of a base plugin.
Parameters
array $base_plugin_definition: The definition array of the base plugin.
Return value
array An array of full derivative definitions keyed on derivative id.
Overrides DeriverBase::getDerivativeDefinitions
See also
getDerivativeDefinition()
File
- src/
Plugin/ Deriver/ EntityIndex.php, line 15
Class
Namespace
Drupal\services\Plugin\DeriverCode
public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->entityTypeManager
->getDefinitions() as $entity_type_id => $entity_type) {
$this->derivatives[$entity_type_id] = $base_plugin_definition;
$this->derivatives[$entity_type_id]['title'] = $this
->t('@label: Index', [
'@label' => $entity_type
->getLabel(),
]);
$this->derivatives[$entity_type_id]['description'] = $this
->t('Index of @entity_type_id objects.', [
'@entity_type_id' => $entity_type_id,
]);
$this->derivatives[$entity_type_id]['category'] = $this
->t('@label', [
'@label' => $entity_type
->getLabel(),
]);
$this->derivatives[$entity_type_id]['path'] = "{$entity_type_id}";
}
return $this->derivatives;
}