menu_cache_clear_all

menu_cache_clear_all() Clears all cached menu data. This should be called any time broad changes might have been made to the router items or menu links. Related topics Menu system Define the navigation menus, local actions and tasks, and contextual links. File core/includes/menu.inc, line 161 API for the Drupal menu system. Code function menu_cache_clear_all() { \Drupal::cache('menu')->invalidateAll(); }

MenuTreeStorageInterface::save

public MenuTreeStorageInterface::save(array $definition) Saves a plugin definition to the storage. Parameters array $definition: A definition for a \Drupal\Core\Menu\MenuLinkInterface plugin. Return value array The menu names affected by the save operation. This will be one menu name if the link is saved to the sane menu, or two if it is saved to a new menu. Throws \Exception Thrown if the storage back-end does not exist and could not be created. \Drupal\Component\Plugin\Exception\PluginExce

MenuTreeStorageInterface::resetDefinitions

public MenuTreeStorageInterface::resetDefinitions() Clears all definitions cached in memory. File core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php, line 24 Class MenuTreeStorageInterface Defines an interface for storing a menu tree containing menu link IDs. Namespace Drupal\Core\Menu Code public function resetDefinitions();

MenuTreeStorageInterface::rebuild

public MenuTreeStorageInterface::rebuild(array $definitions) Rebuilds the stored menu link definitions. Links that saved by passing definitions into this method must be included on all future calls, or they will be purged. This allows for automatic cleanup e.g. when modules are uninstalled. Parameters array $definitions: The new menu link definitions. File core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php, line 36 Class MenuTreeStorageInterface Defines an interface for storing a menu

MenuTreeStorageInterface::menuNameInUse

public MenuTreeStorageInterface::menuNameInUse($menu_name) Determines whether a specific menu name is used in the tree. Parameters string $menu_name: The menu name. Return value bool Returns TRUE if the given menu name is used, otherwise FALSE. File core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php, line 253 Class MenuTreeStorageInterface Defines an interface for storing a menu tree containing menu link IDs. Namespace Drupal\Core\Menu Code public function menuNameInUse($menu_nam

MenuTreeStorageInterface::maxDepth

public MenuTreeStorageInterface::maxDepth() The maximum depth of tree the storage implementation supports. Return value int The maximum depth. File core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php, line 19 Class MenuTreeStorageInterface Defines an interface for storing a menu tree containing menu link IDs. Namespace Drupal\Core\Menu Code public function maxDepth();

MenuTreeStorageInterface::loadTreeData

public MenuTreeStorageInterface::loadTreeData($menu_name, MenuTreeParameters $parameters) Loads a menu link tree from the storage. This function may be used build the data for a menu tree only, for example to further massage the data manually before further processing happens. MenuLinkTree::checkAccess() needs to be invoked afterwards. The tree order is maintained using an optimized algorithm, for example by storing each parent in an individual field, see https://www.drupal.org/node/141866 for

MenuTreeStorageInterface::loadSubtreeData

public MenuTreeStorageInterface::loadSubtreeData($id, $max_relative_depth = NULL) Loads a subtree rooted by the given ID. The returned links are structured like those from loadTreeData(). Parameters string $id: The menu link plugin ID. int $max_relative_depth: (optional) The maximum depth of child menu links relative to the passed in. Defaults to NULL, in which case the full subtree will be returned. Return value array An array with 2 elements: subtree: A fully built menu tree element or FAL

MenuTreeStorageInterface::loadMultiple

public MenuTreeStorageInterface::loadMultiple(array $ids) Loads multiple plugin definitions from the storage. Parameters array $ids: An array of plugin IDs. Return value array An array of plugin definition arrays keyed by plugin ID, which are the actual definitions after the loadMultiple() including all those plugins from $ids. File core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php, line 60 Class MenuTreeStorageInterface Defines an interface for storing a menu tree containing menu l

MenuTreeStorageInterface::loadByRoute

public MenuTreeStorageInterface::loadByRoute($route_name, array $route_parameters = array(), $menu_name = NULL) Loads multiple plugin definitions from the storage based on route. Parameters string $route_name: The route name. array $route_parameters: (optional) The route parameters. Defaults to an empty array. string $menu_name: (optional) Restricts the found links to just those in the named menu. Return value array An array of menu link definitions keyed by ID and ordered by depth. File core