You are here

public function FixedBlockContent::getDerivativeDefinitions in Fixed Block Content 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/FixedBlockContent.php, line 45

Class

FixedBlockContent
Retrieves block plugin definitions for all custom config blocks.

Namespace

Drupal\fixed_block_content\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {

  /** @var \Drupal\fixed_block_content\FixedBlockContentInterface $fixed_block */
  foreach ($this->blockConfigStorage
    ->loadMultiple() as $fixed_block) {
    $this->derivatives[$fixed_block
      ->id()] = $base_plugin_definition;
    $this->derivatives[$fixed_block
      ->id()]['admin_label'] = $fixed_block
      ->label();
    $this->derivatives[$fixed_block
      ->id()]['config_dependencies'][$fixed_block
      ->getConfigDependencyKey()] = [
      $fixed_block
        ->getConfigDependencyName(),
    ];
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}