You are here

public function LayoutBuilderLocalTaskDeriver::getDerivativeDefinitions in Drupal 10

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. 9 core/modules/layout_builder/src/Plugin/Derivative/LayoutBuilderLocalTaskDeriver.php \Drupal\layout_builder\Plugin\Derivative\LayoutBuilderLocalTaskDeriver::getDerivativeDefinitions()

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;
}