MenuLinkManager::rebuild

public MenuLinkManager::rebuild()

Triggers discovery, save, and cleanup of discovered links.

Overrides MenuLinkManagerInterface::rebuild

File

core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 190

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);
}
doc_Drupal
2016-10-29 09:27:07
Comments
Leave a Comment

Please login to continue.