You are here

function commerce_option_set_delete in Commerce Product Option 7

Same name and namespace in other branches
  1. 7.2 commerce_option.module \commerce_option_set_delete()
1 call to commerce_option_set_delete()
commerce_option_set_delete_form_submit in includes/commerce_option_set.forms.inc
Submit callback for commerce_option_set_delete_form().
1 string reference to 'commerce_option_set_delete'
commerce_option_set_delete_form_submit in includes/commerce_option_set.forms.inc
Submit callback for commerce_option_set_delete_form().

File

./commerce_option.module, line 289

Code

function commerce_option_set_delete($set_id) {
  $option_set = commerce_option_set_load($set_id);
  db_delete('commerce_option_set')
    ->condition('set_id', $set_id)
    ->execute();

  // Rebuild the menu to get rid of this option set's edit menu item.
  commerce_option_set_reset();
  menu_rebuild();

  // Notify the field API that this bundle has been destroyed.
  field_attach_delete_bundle('commerce_option', $set_id);

  // Notify other modules that this option set has been deleted.
  module_invoke_all('commerce_option_set_delete', $option_set);
}