You are here

public function MigrateDestinationMenu::rollback in Migrate 7.2

Delete a single menu.

Parameters

$id: Array of fields representing the key (in this case, just menu_name).

File

plugins/destinations/menu.inc, line 146
Support for menu destinations.

Class

MigrateDestinationMenu
Destination class implementing migration into {menu_custom}.

Code

public function rollback(array $id) {
  $menu_name = reset($id);
  migrate_instrument_start('menu_delete');
  $this
    ->prepareRollback($menu_name);
  if ($menu = menu_load($menu_name)) {
    menu_delete($menu);
  }
  $this
    ->completeRollback($menu_name);
  migrate_instrument_stop('menu_delete');
}