You are here

public function MenuTokenMenuLinkManager::rebuildMenuToken in Menu Token 8

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

File

src/Service/MenuTokenMenuLinkManager.php, line 17

Class

MenuTokenMenuLinkManager
Manages discovery, instantiation, and tree building of menu link plugins.

Namespace

Drupal\menu_token\Service

Code

public function rebuildMenuToken($definitions) {
  try {
    $this->moduleHandler
      ->invoke("menu_token", "prepare_context_replacement", [
      &$definitions,
    ]);
  } catch (\Exception $e) {
  }
  $mtts = \Drupal::service('menu_token.tree_storage');
  $mtts
    ->rebuildNonDestructive($definitions);
}