You are here

public function MenuTokenContextManager::__construct in Menu Token 8

Same name and namespace in other branches
  1. 9.1.x src/Service/MenuTokenContextManager.php \Drupal\menu_token\Service\MenuTokenContextManager::__construct()

File

src/Service/MenuTokenContextManager.php, line 28

Class

MenuTokenContextManager
Menu token context manager service.

Namespace

Drupal\menu_token\Service

Code

public function __construct(TokenInterface $tokenService, ContextRepositoryInterface $c, TokenEntityMapperInterface $tem, EntityTypeManagerInterface $en, StateInterface $state, MenuLinkManagerInterface $mlm) {
  $this->tokenService = $tokenService;
  $this->contextRepository = $c;
  $this->tokenEntityMapper = $tem;
  $this->entityTypeManager = $en;
  $this->state = $state;
  $this->menuTokenMenuLinkManager = $mlm;
  $this->contextualReplacementLinks = unserialize($this->state
    ->get('menu_token_links_contextual_replacements'));
  if (empty($this->contextualReplacementLinks)) {
    $this->contextualReplacementLinks = [];
  }
}