You are here

function uc_attribute_option_save in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 uc_attribute/uc_attribute.module \uc_attribute_option_save()
  2. 7.3 uc_attribute/uc_attribute.module \uc_attribute_option_save()

Saves an attribute object to the database.

Parameters

$option: The attribute option object to save.

Return value

The integer result from drupal_write_record().

5 calls to uc_attribute_option_save()
UbercartAttributeTestCase::createAttributeOption in uc_attribute/uc_attribute.test
Creates an attribute option.
UbercartAttributeTestCase::testAttributeUIAttributeOptions in uc_attribute/uc_attribute.test
Tests the attribute options user interface.
UbercartAttributeTestCase::testAttributeUIAttributeOptionsBulkEdit in uc_attribute/uc_attribute.test
Tests the "bulk edit attribute options" user interface.
UbercartAttributeTestCase::testAttributeUIAttributeOptionsDelete in uc_attribute/uc_attribute.test
Tests the "delete attribute option" user interface.
UbercartAttributeTestCase::testAttributeUIAttributeOptionsEdit in uc_attribute/uc_attribute.test
Tests the "edit attribute options" user interface.

File

uc_attribute/uc_attribute.module, line 860

Code

function uc_attribute_option_save(&$option) {

  // Insert or update?
  $key = empty($option->oid) ? NULL : 'oid';
  return drupal_write_record('uc_attribute_options', $option, $key);
}