You are here

function commerce_option_set_save in Commerce Product Option 7

Same name and namespace in other branches
  1. 7.2 commerce_option.module \commerce_option_set_save()

Saves a option set.

This function will either insert a new option set if $option_set['is_new'] is set or attempt to update an existing option set if it is not. It does not currently support changing the machine-readable name of the option set, nor is this possible through the form supplied by the Option module.

Parameters

$option_set: The option set array containing the basic properties as initialized in commerce_option_set_new().

Return value

The return value of the call to drupal_write_record() to save the option set, either FALSE on failure or SAVED_NEW or SAVED_UPDATED indicating the type of query performed to save the option set.

1 call to commerce_option_set_save()
commerce_option_set_form_submit in includes/commerce_option_set.forms.inc
Form submit handler for the option set

File

./commerce_option.module, line 276

Code

function commerce_option_set_save(CommerceOptionSet $set) {

  // Store the entity, must be done before they are configured
  $set
    ->save();

  // Ensure the creation of the rules (components)
  entity_defaults_rebuild();
  menu_rebuild();
  return $set;
}