You are here

public function MenuLinkManager::rebuild in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::rebuild()

Triggers discovery, save, and cleanup of discovered links.

Overrides MenuLinkManagerInterface::rebuild

File

core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 195
Contains \Drupal\Core\Menu\MenuLinkManager.

Class

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

Namespace

Drupal\Core\Menu

Code

public function rebuild() {
  $definitions = $this
    ->getDefinitions();

  // Apply overrides from config.
  $overrides = $this->overrides
    ->loadMultipleOverrides(array_keys($definitions));
  foreach ($overrides as $id => $changes) {
    if (!empty($definitions[$id])) {
      $definitions[$id] = $changes + $definitions[$id];
    }
  }
  $this->treeStorage
    ->rebuild($definitions);
}