You are here

function groupmenu_group_delete in Group Menu 8

Implements hook_ENTITY_TYPE_delete().

File

./groupmenu.module, line 319
Gives the ability to create and manage menus for groups.

Code

function groupmenu_group_delete(EntityInterface $entity) {
  $autocreated_menu = \Drupal::entityTypeManager()
    ->getStorage('menu')
    ->load('group-' . $entity
    ->id() . '-menu');
  if ($autocreated_menu) {
    $autocreated_menu
      ->delete();
  }
}