public function DerivedAccessControlPlugins::getDerivativeDefinitions in Workbench Access 8
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
- tests/
modules/ workbench_access_test/ src/ Plugin/ Derivative/ DerivedAccessControlPlugins.php, line 15
Class
- DerivedAccessControlPlugins
- Defines a class for deriving plugins for test-sake.
Namespace
Drupal\workbench_access_test\Plugin\DerivativeCode
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = [];
foreach ([
'foo',
'bar',
] as $plugin_id) {
$this->derivatives[$plugin_id] = [
'label' => sprintf('Plugin for %s', $plugin_id),
] + $base_plugin_definition;
}
return $this->derivatives;
}