public function BlockGroups::getDerivativeDefinitions in Block Group 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
- src/
Plugin/ Derivative/ BlockGroups.php, line 47
Class
- BlockGroups
- Provides block plugin definitions for blockgroup blocks.
Namespace
Drupal\blockgroup\Plugin\DerivativeCode
public function getDerivativeDefinitions($base_plugin_definition) {
$block_groups = $this->blockGroupStorage
->loadMultiple();
foreach ($block_groups as $block_group) {
$this->derivatives[$block_group
->id()] = $base_plugin_definition;
$this->derivatives[$block_group
->id()]['admin_label'] = $block_group
->label();
$this->derivatives[$block_group
->id()]['config_dependencies'][$block_group
->getConfigDependencyKey()] = [
$block_group
->getConfigDependencyName(),
];
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}