public function MenuLinkDefault::updateLink in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Menu/MenuLinkDefault.php \Drupal\Core\Menu\MenuLinkDefault::updateLink()
- 9 core/lib/Drupal/Core/Menu/MenuLinkDefault.php \Drupal\Core\Menu\MenuLinkDefault::updateLink()
File
- core/lib/Drupal/Core/Menu/MenuLinkDefault.php, line 86
Class
- MenuLinkDefault
- Provides a default implementation for menu link plugins.
Namespace
Drupal\Core\Menu
Code
public function updateLink(array $new_definition_values, $persist) {
$overrides = array_intersect_key($new_definition_values, $this->overrideAllowed);
$this->pluginDefinition = $overrides + $this
->getPluginDefinition();
if ($persist) {
$overrides['menu_name'] = $this->pluginDefinition['menu_name'];
$this->staticOverride
->saveOverride($this
->getPluginId(), $this->pluginDefinition);
}
return $this->pluginDefinition;
}