function DefaultMenuLinkTreeManipulators::__construct

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

Constructs a \Drupal\Core\Menu\DefaultMenuLinkTreeManipulators object.

Parameters

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

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

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

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

File

core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php, line 63

Class

DefaultMenuLinkTreeManipulators
Provides a couple of menu link tree manipulators.

Namespace

Drupal\Core\Menu

Code

public function __construct(AccessManagerInterface $access_manager, AccountInterface $account, EntityTypeManagerInterface $entity_type_manager, ?ModuleHandlerInterface $module_handler = NULL) {
    $this->accessManager = $access_manager;
    $this->account = $account;
    $this->entityTypeManager = $entity_type_manager;
    if ($module_handler === NULL) {
        @trigger_error('Calling DefaultMenuLinkTreeManipulators::__construct() without the $module_handler argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3336973', E_USER_DEPRECATED);
        $module_handler = \Drupal::moduleHandler();
    }
    $this->moduleHandler = $module_handler;
}

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