Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MenuLinkManagerInterface.php

function MenuLinkManagerInterface::updateDefinition

Updates the values for a menu link definition in the menu tree storage.

This will update the definition for a discovered menu link without the need for a full rebuild. It is also used for plugins not found through discovery to update definitions.

Parameters

string $id: The menu link plugin ID.

array $new_definition_values: The new values for the link definition. This will usually be just a subset of the plugin definition.

bool $persist: TRUE to also have the link instance itself persist the changed values to any additional storage by invoking MenuLinkInterface::updateDefinition() on the plugin that is being updated.

Return value

\Drupal\Core\Menu\MenuLinkInterface A plugin instance created using the updated definition.

Throws

\Drupal\Component\Plugin\Exception\PluginException Thrown if the $id is not a valid, existing, plugin ID.

1 method overrides MenuLinkManagerInterface::updateDefinition()
MenuLinkManager::updateDefinition in core/lib/Drupal/Core/Menu/MenuLinkManager.php
Updates the values for a menu link definition in the menu tree storage.

File

core/lib/Drupal/Core/Menu/MenuLinkManagerInterface.php, line 119

Class

MenuLinkManagerInterface
Defines an interface for managing menu links and storing their definitions.

Namespace

Drupal\Core\Menu

Code

public function updateDefinition($id, array $new_definition_values, $persist = TRUE);

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal