You are here

public function PluginSelectorDeriver::getDerivativeDefinitions in Plugin 8.2

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/Field/FieldWidget/PluginSelectorDeriver.php, line 39

Class

PluginSelectorDeriver
Derives plugin selector field widgets.

Namespace

Drupal\plugin\Plugin\Field\FieldWidget

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->pluginSelectorManager
    ->getDefinitions() as $plugin_id => $plugin_definition) {
    $this->derivatives[$plugin_id] = [
      'description' => isset($plugin_definition['description']) ? $plugin_definition['description'] : NULL,
      'label' => $plugin_definition['label'],
      'plugin_selector_id' => $plugin_id,
    ] + $base_plugin_definition;
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}