public function CustomBlock::getDerivativeDefinition

Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinition().

Retrieves a specific custom block definition from storage.

Overrides DerivativeInterface::getDerivativeDefinition

File

drupal/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Derivative/CustomBlock.php, line 29
Contains \Drupal\custom_block\Plugin\Derivative\CustomBlock.

Class

CustomBlock
Retrieves block plugin definitions for all custom blocks.

Namespace

Drupal\custom_block\Plugin\Derivative

Code

public function getDerivativeDefinition($derivative_id, array $base_plugin_definition) {
  if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) {
    return $this->derivatives[$derivative_id];
  }
  $this
    ->getDerivativeDefinitions($base_plugin_definition);
  return $this->derivatives[$derivative_id];
}