public function DsLocalTask::getDerivativeDefinitions in Display Suite 8.2
Same name and namespace in other branches
- 8.4 src/Plugin/Derivative/DsLocalTask.php \Drupal\ds\Plugin\Derivative\DsLocalTask::getDerivativeDefinitions()
- 8.3 src/Plugin/Derivative/DsLocalTask.php \Drupal\ds\Plugin\Derivative\DsLocalTask::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/ Derivative/ DsLocalTask.php, line 52
Class
- DsLocalTask
- Provides local task definitions for all entity bundles.
Namespace
Drupal\ds\Plugin\DerivativeCode
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = array();
foreach ($this->entityTypeManager
->getDefinitions() as $entity_type_id => $entity_type) {
if ($entity_type
->hasLinkTemplate('display')) {
$this->derivatives["{$entity_type_id}.display_tab"] = array(
'route_name' => "entity.{$entity_type_id}.display",
'weight' => 10,
'title' => $this
->t('Manage display'),
'base_route' => "entity.{$entity_type_id}.canonical",
);
}
}
foreach ($this->derivatives as &$entry) {
$entry += $base_plugin_definition;
}
return $this->derivatives;
}