You are here

public function GroupMenuBlock::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/Derivative/GroupMenuBlock.php, line 44

Class

GroupMenuBlock
Provides block plugin definitions for custom menus.

Namespace

Drupal\group_content_menu\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->menuStorage
    ->loadMultiple() as $entity) {
    $this->derivatives[$entity
      ->id()] = $base_plugin_definition;
    $this->derivatives[$entity
      ->id()]['admin_label'] = $entity
      ->label();
    $this->derivatives[$entity
      ->id()]['config_dependencies']['config'] = [
      $entity
        ->getConfigDependencyName(),
    ];
  }
  return $this->derivatives;
}