You are here

public function QuickTabsBlock::getDerivativeDefinitions in Quick Tabs 8.3

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/QuickTabsBlock.php, line 17

Class

QuickTabsBlock
Provides block plugin definitions for quicktabs blocks.

Namespace

Drupal\quicktabs\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach (\Drupal::entityTypeManager()
    ->getStorage('quicktabs_instance')
    ->loadMultiple() as $machine_name => $entity) {
    $this->derivatives[$machine_name] = $base_plugin_definition;
    $this->derivatives[$machine_name]['admin_label'] = 'QuickTabs - ' . $entity
      ->label();
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}