function SystemMenuNavigationBlock::getDerivativeDefinitions

Same name in other branches
  1. 11.x core/modules/navigation/src/Plugin/Derivative/SystemMenuNavigationBlock.php \Drupal\navigation\Plugin\Derivative\SystemMenuNavigationBlock::getDerivativeDefinitions()

Overrides DeriverBase::getDerivativeDefinitions

File

core/modules/navigation/src/Plugin/Derivative/SystemMenuNavigationBlock.php, line 40

Class

SystemMenuNavigationBlock
Provides navigation block plugin definitions for custom menus.

Namespace

Drupal\navigation\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) : array {
    foreach ($this->menuStorage
        ->loadMultiple() as $menu => $entity) {
        $this->derivatives[$menu] = $base_plugin_definition;
        $this->derivatives[$menu]['admin_label'] = $entity->label();
        $this->derivatives[$menu]['config_dependencies']['config'] = [
            $entity->getConfigDependencyName(),
        ];
    }
    return $this->derivatives;
}

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