You are here

public function ToolbarMenuManager::__construct in Toolbar Menu 8

Same name and namespace in other branches
  1. 8.2 src/ToolbarMenuManager.php \Drupal\toolbar_menu\ToolbarMenuManager::__construct()

Construct a new ToolbarMenu.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager: The entity manager.

\Drupal\Core\Session\AccountProxyInterface $account: The account service.

File

src/ToolbarMenuManager.php, line 46

Class

ToolbarMenuManager
Implement a setting form for toolbar_menu module.

Namespace

Drupal\toolbar_menu

Code

public function __construct(EntityTypeManagerInterface $entity_manager, AccountProxyInterface $account) {
  $this->entityManager = $entity_manager;
  $this->account = $account
    ->getAccount();
  $this->toolbarMenuElements = $this->entityManager
    ->getStorage('toolbar_menu_element')
    ->loadMultiple();
}