You are here

public function LayoutBuilderLocalTaskDeriver::getDerivativeDefinitions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/Derivative/LayoutBuilderLocalTaskDeriver.php \Drupal\layout_builder\Plugin\Derivative\LayoutBuilderLocalTaskDeriver::getDerivativeDefinitions()
  2. 10 core/modules/layout_builder/src/Plugin/Derivative/LayoutBuilderLocalTaskDeriver.php \Drupal\layout_builder\Plugin\Derivative\LayoutBuilderLocalTaskDeriver::getDerivativeDefinitions()

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

core/modules/layout_builder/src/Plugin/Derivative/LayoutBuilderLocalTaskDeriver.php, line 65

Class

LayoutBuilderLocalTaskDeriver
Provides local task definitions for the layout builder user interface.

Namespace

Drupal\layout_builder\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->sectionStorageManager
    ->getDefinitions() as $plugin_id => $definition) {
    $section_storage = $this->sectionStorageManager
      ->loadEmpty($plugin_id);
    if ($section_storage instanceof SectionStorageLocalTaskProviderInterface) {
      $this->derivatives += $section_storage
        ->buildLocalTasks($base_plugin_definition);
    }
  }
  return $this->derivatives;
}