You are here

public function BlocktabsBlock::getDerivativeDefinitions in Block Tabs 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/BlocktabsBlock.php, line 46

Class

BlocktabsBlock
Provides block plugin definitions for blocktabs.

Namespace

Drupal\blocktabs\Plugin\Derivative

Code

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