function MenuLinkInterface::updateLink

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuLinkInterface.php \Drupal\Core\Menu\MenuLinkInterface::updateLink()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuLinkInterface.php \Drupal\Core\Menu\MenuLinkInterface::updateLink()
  3. 11.x core/lib/Drupal/Core/Menu/MenuLinkInterface.php \Drupal\Core\Menu\MenuLinkInterface::updateLink()

Updates the definition values for a menu link.

Depending on the implementation details of the class, not all definition values may be changed. For example, changes to the title of a static link will be discarded.

In general, this method should not be called directly, but will be called automatically from MenuLinkManagerInterface::updateDefinition().

Parameters

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 have the link persist the changed values to any additional storage.

Return value

array The plugin definition incorporating any allowed changes.

5 methods override MenuLinkInterface::updateLink()
InaccessibleMenuLink::updateLink in core/lib/Drupal/Core/Menu/InaccessibleMenuLink.php
Updates the definition values for a menu link.
MenuLinkContent::updateLink in core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php
Updates the definition values for a menu link.
MenuLinkDefault::updateLink in core/lib/Drupal/Core/Menu/MenuLinkDefault.php
Updates the definition values for a menu link.
MenuLinkMock::updateLink in core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php
Updates the definition values for a menu link.
ViewsMenuLink::updateLink in core/modules/views/src/Plugin/Menu/ViewsMenuLink.php
Updates the definition values for a menu link.

File

core/lib/Drupal/Core/Menu/MenuLinkInterface.php, line 170

Class

MenuLinkInterface
Defines an interface for classes providing a type of menu link.

Namespace

Drupal\Core\Menu

Code

public function updateLink(array $new_definition_values, $persist);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.