function ContextualLinkManager::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/ContextualLinkManager.php \Drupal\Core\Menu\ContextualLinkManager::__construct()
  2. 10 core/lib/Drupal/Core/Menu/ContextualLinkManager.php \Drupal\Core\Menu\ContextualLinkManager::__construct()
  3. 11.x core/lib/Drupal/Core/Menu/ContextualLinkManager.php \Drupal\Core\Menu\ContextualLinkManager::__construct()

Constructs a new ContextualLinkManager instance.

Parameters

\Drupal\Core\Controller\ControllerResolverInterface $controller_resolver: The controller resolver.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: The cache backend.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\Access\AccessManagerInterface $access_manager: The access manager.

\Drupal\Core\Session\AccountInterface $account: The current user.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

Overrides DefaultPluginManager::__construct

File

core/lib/Drupal/Core/Menu/ContextualLinkManager.php, line 100

Class

ContextualLinkManager
Defines a contextual link plugin manager to deal with contextual links.

Namespace

Drupal\Core\Menu

Code

public function __construct(ControllerResolverInterface $controller_resolver, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account, RequestStack $request_stack) {
    $this->factory = new ContainerFactory($this, '\\Drupal\\Core\\Menu\\ContextualLinkInterface');
    $this->controllerResolver = $controller_resolver;
    $this->accessManager = $access_manager;
    $this->account = $account;
    $this->moduleHandler = $module_handler;
    $this->requestStack = $request_stack;
    $this->alterInfo('contextual_links_plugins');
    $this->setCacheBackend($cache_backend, 'contextual_links_plugins:' . $language_manager->getCurrentLanguage()
        ->getId(), [
        'contextual_links_plugins',
    ]);
}

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