You are here

public function MenuLinkTreeManipulators::__construct in Menu Manipulator 8

Same name and namespace in other branches
  1. 8.2 src/Menu/MenuLinkTreeManipulators.php \Drupal\menu_manipulator\Menu\MenuLinkTreeManipulators::__construct()
  2. 3.0.x src/Menu/MenuLinkTreeManipulators.php \Drupal\menu_manipulator\Menu\MenuLinkTreeManipulators::__construct()
  3. 2.0.x src/Menu/MenuLinkTreeManipulators.php \Drupal\menu_manipulator\Menu\MenuLinkTreeManipulators::__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\Language\LanguageManager $language_manager: The language manager.

\Drupal\Core\Entity\EntityRepository $entity_repository: The entity repository.

Overrides DefaultMenuLinkTreeManipulators::__construct

File

src/Menu/MenuLinkTreeManipulators.php, line 95

Class

MenuLinkTreeManipulators
Provides a couple of menu link tree manipulators.

Namespace

Drupal\menu_manipulator\Menu

Code

public function __construct(AccessManagerInterface $access_manager, AccountInterface $account, EntityTypeManagerInterface $entity_type_manager, LanguageManager $language_manager, EntityRepository $entity_repository) {
  $this->accessManager = $access_manager;
  $this->account = $account;
  $this->entityTypeManager = $entity_type_manager;
  $this->entityRepository = $entity_repository;
  $this->langcode = $language_manager
    ->getCurrentLanguage()
    ->getId();
  $this->languages = $language_manager
    ->getLanguages();
  $this->menuLinkContentStorage = $this->entityTypeManager
    ->getStorage('menu_link_content');
}