protected function ShortcutStorageController::preDelete

Overrides \Drupal\Core\Entity\ConfigStorageController::preDelete().

Overrides ConfigStorageController::preDelete

File

drupal/core/modules/shortcut/lib/Drupal/shortcut/ShortcutStorageController.php, line 94
Contains \Drupal\shortcut\ShortcutStorageController.

Class

ShortcutStorageController
Defines a storage controller for shortcut entities.

Namespace

Drupal\shortcut

Code

protected function preDelete($entities) {
  foreach ($entities as $entity) {

    // First, delete any user assignments for this set, so that each of these
    // users will go back to using whatever default set applies.
    db_delete('shortcut_set_users')
      ->condition('set_name', $entity
      ->id())
      ->execute();

    // Next, delete the menu links for this set.
    menu_delete_links('shortcut-' . $entity
      ->id());
  }
  parent::preDelete($entities);
}