class MenuTokenMenuLinkManager in Menu Token 8
Same name and namespace in other branches
- 9.1.x src/Service/MenuTokenMenuLinkManager.php \Drupal\menu_token\Service\MenuTokenMenuLinkManager
Manages discovery, instantiation, and tree building of menu link plugins.
This manager finds plugins that are rendered as menu links.
Hierarchy
- class \Drupal\Core\Menu\MenuLinkManager implements MenuLinkManagerInterface
- class \Drupal\menu_token\Service\MenuTokenMenuLinkManager
Expanded class hierarchy of MenuTokenMenuLinkManager
1 string reference to 'MenuTokenMenuLinkManager'
1 service uses MenuTokenMenuLinkManager
File
- src/
Service/ MenuTokenMenuLinkManager.php, line 12
Namespace
Drupal\menu_token\ServiceView source
class MenuTokenMenuLinkManager extends MenuLinkManager {
/**
* {@inheritdoc}
*/
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);
}
/**
* {@inheritdoc}
*/
public function getMenuTreeStorage() {
return $this->treeStorage;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MenuLinkManager:: |
protected | property | Provides some default values for the definition of all menu link plugins. | |
MenuLinkManager:: |
protected | property | The object that discovers plugins managed by this manager. | |
MenuLinkManager:: |
protected | property | The object that instantiates plugins managed by this manager. | |
MenuLinkManager:: |
protected | property | The module handler. | |
MenuLinkManager:: |
protected | property | Service providing overrides for static links. | |
MenuLinkManager:: |
protected | property | The menu link tree storage. | |
MenuLinkManager:: |
public | function |
Adds a new menu link definition to the menu tree storage. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Counts the total number of menu links. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Returns a pre-configured menu link plugin instance. Overrides FactoryInterface:: |
|
MenuLinkManager:: |
protected | function | Deletes a specific instance. | |
MenuLinkManager:: |
public | function |
Deletes all links having a certain menu name. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Loads all child link IDs of a given menu link, regardless of visibility. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Gets a specific plugin definition. Overrides DiscoveryInterface:: |
|
MenuLinkManager:: |
public | function |
Gets the definition of all plugins for this type. Overrides DiscoveryInterface:: |
|
MenuLinkManager:: |
protected | function | Gets the plugin discovery. | |
MenuLinkManager:: |
protected | function | Gets the plugin factory. | |
MenuLinkManager:: |
public | function |
Gets a preconfigured instance of a plugin. Overrides MapperInterface:: |
|
MenuLinkManager:: |
public | function |
Loads all parent link IDs of a given menu link. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Indicates if a specific plugin definition exists. Overrides DiscoveryInterface:: |
|
MenuLinkManager:: |
public | function |
Loads multiple plugin instances based on route. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Determines if any links use a given menu name. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
protected | function | Performs extra processing on plugin definitions. | |
MenuLinkManager:: |
public | function |
Triggers discovery, save, and cleanup of discovered links. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Removes a single link definition from the menu tree storage. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Resets any local definition cache. Used for testing. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
protected | function | Resets the menu link to its default settings. | |
MenuLinkManager:: |
public | function |
Resets the values for a menu link based on the values found by discovery. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function |
Updates the values for a menu link definition in the menu tree storage. Overrides MenuLinkManagerInterface:: |
|
MenuLinkManager:: |
public | function | Constructs a \Drupal\Core\Menu\MenuLinkManager object. | |
MenuTokenMenuLinkManager:: |
public | function | ||
MenuTokenMenuLinkManager:: |
public | function |