function LocalActionManager::__construct

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

Constructs a LocalActionManager object.

Parameters

\Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface $argument_resolver: An object to use in resolving route arguments.

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

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

\Drupal\Core\Routing\RouteProviderInterface $route_provider: The route provider.

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

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\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.

Overrides DefaultPluginManager::__construct

1 method overrides LocalActionManager::__construct()
TestLocalActionManager::__construct in core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
Constructs a LocalActionManager object.

File

core/lib/Drupal/Core/Menu/LocalActionManager.php, line 128

Class

LocalActionManager
Provides the default local action manager using YML as primary definition.

Namespace

Drupal\Core\Menu

Code

public function __construct(ArgumentResolverInterface $argument_resolver, RequestStack $request_stack, RouteMatchInterface $route_match, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
    // Skip calling the parent constructor, since that assumes annotation-based
    // discovery.
    $this->factory = new ContainerFactory($this, 'Drupal\\Core\\Menu\\LocalActionInterface');
    $this->argumentResolver = $argument_resolver;
    $this->requestStack = $request_stack;
    $this->routeMatch = $route_match;
    $this->routeProvider = $route_provider;
    $this->accessManager = $access_manager;
    $this->moduleHandler = $module_handler;
    $this->account = $account;
    $this->languageManager = $language_manager;
    $this->alterInfo('menu_local_actions');
    $this->setCacheBackend($cache_backend, 'local_action_plugins:' . $language_manager->getCurrentLanguage()
        ->getId());
}

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