function LayoutBuilderLocalTaskDeriver::getDerivativeDefinitions

Same name and namespace in other branches
  1. 9 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()
  3. 11.x core/modules/layout_builder/src/Plugin/Derivative/LayoutBuilderLocalTaskDeriver.php \Drupal\layout_builder\Plugin\Derivative\LayoutBuilderLocalTaskDeriver::getDerivativeDefinitions()

Overrides DeriverBase::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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.