You are here

public function MenuLinkContent::requiresRediscovery in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/menu_link_content/src/Entity/MenuLinkContent.php \Drupal\menu_link_content\Entity\MenuLinkContent::requiresRediscovery()

Returns whether the menu link requires rediscovery.

If a menu-link points to a user-supplied path such as /blog then the route this resolves to needs to be rediscovered as the module or route providing a given path might change over time.

For example: at the time a menu-link is created, the /blog path might be provided by a route in Views module, but later this path may be served by the Panels module. Flagging a link as requiring rediscovery ensures that if the route that provides a user-entered path changes over time, the link is flexible enough to update to reflect these changes.

Return value

bool TRUE if the menu link requires rediscovery during route rebuilding.

Overrides MenuLinkContentInterface::requiresRediscovery

File

core/modules/menu_link_content/src/Entity/MenuLinkContent.php, line 415

Class

MenuLinkContent
Defines the menu link content entity class.

Namespace

Drupal\menu_link_content\Entity

Code

public function requiresRediscovery() {
  return $this
    ->get('rediscover')->value;
}