You are here

function uc_attribute_save in Ubercart 6.2

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

Saves an attribute object to the database.

Parameters

$attribute: The attribute object to save.

Return value

The integer result from drupal_write_record().

1 call to uc_attribute_save()
UbercartAttributeTestCase::createAttribute in uc_attribute/uc_attribute.test
Tests the product class attribute option user interface.

File

uc_attribute/uc_attribute.module, line 809

Code

function uc_attribute_save(&$attribute) {

  // Insert or update?
  $key = empty($attribute->aid) ? NULL : 'aid';
  return drupal_write_record('uc_attributes', $attribute, $key);
}