You are here

public function GroupContentMenuDeriver::getDerivativeDefinitions in Group Content Menu 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/GroupContentEnabler/GroupContentMenuDeriver.php, line 18

Class

GroupContentMenuDeriver
Group menu deriver.

Namespace

Drupal\group_content_menu\Plugin\GroupContentEnabler

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach (GroupContentMenuType::loadMultiple() as $name => $group_menu_type) {
    $label = $group_menu_type
      ->label();
    $this->derivatives[$name] = [
      'entity_bundle' => $name,
      'label' => $this
        ->t('Group menu (@type)', [
        '@type' => $label,
      ]),
      'description' => $this
        ->t('Adds %type menu items to groups.', [
        '%type' => $label,
      ]),
    ] + $base_plugin_definition;
  }
  return $this->derivatives;
}