You are here

public function MenuLinkEntity::__construct in Admin Toolbar 8.2

Same name and namespace in other branches
  1. 3.x admin_toolbar_tools/src/Plugin/Menu/MenuLinkEntity.php \Drupal\admin_toolbar_tools\Plugin\Menu\MenuLinkEntity::__construct()

Constructs a new MenuLinkEntity.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Menu\StaticMenuLinkOverridesInterface $static_override: The static override storage.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

Overrides MenuLinkDefault::__construct

File

admin_toolbar_tools/src/Plugin/Menu/MenuLinkEntity.php, line 38

Class

MenuLinkEntity
Provides a menu link plugins for configuration entities.

Namespace

Drupal\admin_toolbar_tools\Plugin\Menu

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, StaticMenuLinkOverridesInterface $static_override, EntityTypeManagerInterface $entity_type_manager) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $static_override);
  $this->entity = $entity_type_manager
    ->getStorage($this->pluginDefinition['metadata']['entity_type'])
    ->load($this->pluginDefinition['metadata']['entity_id']);
}