MenuLinkManager::getDefinition

public MenuLinkManager::getDefinition($plugin_id, $exception_on_invalid = TRUE) Gets a specific plugin definition. Parameters string $plugin_id: A plugin id. bool $exception_on_invalid: (optional) If TRUE, an invalid plugin ID will throw an exception. Return value mixed A plugin definition, or NULL if the plugin ID is invalid and $exception_on_invalid is FALSE. Throws \Drupal\Component\Plugin\Exception\PluginNotFoundException Thrown if $plugin_id is invalid and $exception_on_invalid is TRUE.

MenuLinkManager::getChildIds

public MenuLinkManager::getChildIds($id) Loads all child link IDs of a given menu link, regardless of visibility. This method is mostly useful for testing. Parameters string $id: The menu link plugin ID. Return value array An unordered array of IDs representing the IDs of all children, or NULL if the ID is invalid. Overrides MenuLinkManagerInterface::getChildIds File core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 326 Class MenuLinkManager Manages discovery, instantiation, and tree b

MenuLinkManager::deleteLinksInMenu

public MenuLinkManager::deleteLinksInMenu($menu_name) Deletes all links having a certain menu name. If a link is not deletable but is resettable, the link will be reset to have its original menu name, under the assumption that the original menu is not the one we are deleting it from. Note that when resetting, if the original menu name is the same as the menu name passed to this method, the link will not be moved or deleted. Parameters string $menu_name: The name of the menu whose links will be

MenuLinkManager::deleteInstance

protected MenuLinkManager::deleteInstance(MenuLinkInterface $instance, $persist) Deletes a specific instance. Parameters \Drupal\Core\Menu\MenuLinkInterface $instance: The plugin instance to be deleted. bool $persist: If TRUE, calls MenuLinkInterface::deleteLink() on the instance. Throws \Drupal\Component\Plugin\Exception\PluginException If the plugin instance does not support deletion. File core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 274 Class MenuLinkManager Manages discovery,

MenuLinkManager::createInstance

public MenuLinkManager::createInstance($plugin_id, array $configuration = array()) Returns a pre-configured menu link plugin instance. Parameters string $plugin_id: The ID of the plugin being instantiated. array $configuration: An array of configuration relevant to the plugin instance. Return value \Drupal\Core\Menu\MenuLinkInterface A menu link instance. Throws \Drupal\Component\Plugin\Exception\PluginException If the instance cannot be created, such as if the ID is invalid. Overrides Facto

MenuLinkManager::countMenuLinks

public MenuLinkManager::countMenuLinks($menu_name = NULL) Counts the total number of menu links. Parameters string $menu_name: (optional) The menu name to count by. Defaults to all menus. Return value int The number of menu links in the named menu, or in all menus if the menu name is NULL. Overrides MenuLinkManagerInterface::countMenuLinks File core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 309 Class MenuLinkManager Manages discovery, instantiation, and tree building of menu link pl

MenuLinkManager::addDefinition

public MenuLinkManager::addDefinition($id, array $definition) Adds a new menu link definition to the menu tree storage. Use this function when you know there is no entry in the tree. This is used for plugins not found through discovery to add new definitions. Parameters string $id: The plugin ID for the new menu link definition that is being added. array $definition: The values of the link definition. Return value \Drupal\Core\Menu\MenuLinkInterface A plugin instance created using the newly a

MenuLinkManager::$treeStorage

The menu link tree storage. Type: \Drupal\Core\Menu\MenuTreeStorageInterface File core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 81 Class MenuLinkManager Manages discovery, instantiation, and tree building of menu link plugins. Namespace Drupal\Core\Menu Code protected $treeStorage;

MenuLinkManager::$overrides

Service providing overrides for static links. Type: \Drupal\Core\Menu\StaticMenuLinkOverridesInterface File core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 88 Class MenuLinkManager Manages discovery, instantiation, and tree building of menu link plugins. Namespace Drupal\Core\Menu Code protected $overrides;

MenuLinkManager::$moduleHandler

The module handler. Type: \Drupal\Core\Extension\ModuleHandlerInterface File core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 95 Class MenuLinkManager Manages discovery, instantiation, and tree building of menu link plugins. Namespace Drupal\Core\Menu Code protected $moduleHandler;