public function MicrositeMenuItem::getDeleteRoute in Entity Reference Hierarchy 3.x
Same name and namespace in other branches
- 8.2 modules/entity_hierarchy_microsite/src/Plugin/Menu/MicrositeMenuItem.php \Drupal\entity_hierarchy_microsite\Plugin\Menu\MicrositeMenuItem::getDeleteRoute()
Returns route information for a route to delete the menu link.
Return value
\Drupal\Core\Url|null A Url object, or NULL if there is no route (e.g. when the link is not deletable).
Overrides MenuLinkBase::getDeleteRoute
File
- modules/
entity_hierarchy_microsite/ src/ Plugin/ Menu/ MicrositeMenuItem.php, line 101
Class
- MicrositeMenuItem
- Defines a class for a menu item based on hierarchy.
Namespace
Drupal\entity_hierarchy_microsite\Plugin\MenuCode
public function getDeleteRoute() {
if (!$this
->getOverrideEntity()
->isNew()) {
return $this
->getOverrideEntity()
->toUrl('delete-form');
}
}