function uc_attribute_option_delete in Ubercart 7.3
Same name and namespace in other branches
- 8.4 uc_attribute/uc_attribute.module \uc_attribute_option_delete()
- 6.2 uc_attribute/uc_attribute.module \uc_attribute_option_delete()
Deletes an attribute option from the database.
Parameters
int $oid: Option ID to delete.
Return value
int The Drupal SAVED_DELETED flag.
File
- uc_attribute/
uc_attribute.module, line 837 - Ubercart Attribute module.
Code
function uc_attribute_option_delete($oid) {
// Delete the class attribute options.
uc_attribute_subject_option_delete($oid, 'class');
// Delete the product attribute options (and the adjustments!).
uc_attribute_subject_option_delete($oid, 'product');
// Delete base attributes and their options.
db_delete('uc_attribute_options')
->condition('oid', $oid)
->execute();
return SAVED_DELETED;
}