function ViewsEntityRow::getDerivativeDefinitions
Same name and namespace in other branches
- 11.x core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php \Drupal\views\Plugin\Derivative\ViewsEntityRow::getDerivativeDefinitions()
- 10 core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php \Drupal\views\Plugin\Derivative\ViewsEntityRow::getDerivativeDefinitions()
- 9 core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php \Drupal\views\Plugin\Derivative\ViewsEntityRow::getDerivativeDefinitions()
- 8.9.x core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php \Drupal\views\Plugin\Derivative\ViewsEntityRow::getDerivativeDefinitions()
Gets the definition of all derivatives of a base plugin.
Parameters
array|\Drupal\Component\Plugin\Definition\PluginDefinitionInterface $base_plugin_definition: The definition of the base plugin from which the derivative plugin is derived. It is maybe an entire object or just some array, depending on the discovery mechanism.
Return value
array An array of full derivative definitions keyed on derivative id.
Overrides DeriverInterface::getDerivativeDefinitions
1 call to ViewsEntityRow::getDerivativeDefinitions()
- ViewsEntityRow::getDerivativeDefinition in core/
modules/ views/ src/ Plugin/ Derivative/ ViewsEntityRow.php - Gets the definition of a derivative plugin.
File
-
core/
modules/ views/ src/ Plugin/ Derivative/ ViewsEntityRow.php, line 91
Class
- ViewsEntityRow
- Provides views row plugin definitions for all non-special entity types.
Namespace
Drupal\views\Plugin\DerivativeCode
public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->entityTypeManager
->getDefinitions() as $entity_type_id => $entity_type) {
// Just add support for entity types which have a views integration.
if (($base_table = $entity_type->getBaseTable()) && $this->viewsData
->get($base_table) && $this->entityTypeManager
->hasHandler($entity_type_id, 'view_builder')) {
$this->derivatives[$entity_type_id] = [
'id' => 'entity:' . $entity_type_id,
'provider' => 'views',
'title' => $this->t('@label view mode', [
'@label' => $entity_type->getLabel(),
]),
'help' => $this->t('Display the @label', [
'@label' => $entity_type->getLabel(),
]),
'base' => [
$entity_type->getDataTable() ?: $entity_type->getBaseTable(),
],
'entity_type' => $entity_type_id,
'display_types' => [
'normal',
],
'class' => $base_plugin_definition['class'],
];
}
}
return $this->derivatives;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.