You are here

function uc_attribute_save in Ubercart 7.3

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

Saves an attribute object to the database.

Parameters

object $attribute: The attribute object to save.

Return value

int The integer result from drupal_write_record().

2 calls to uc_attribute_save()
UbercartAttributeTestCase::createAttribute in uc_attribute/tests/uc_attribute.test
Creates an attribute.
UbercartTaxesTestCase::testInclusiveTaxes in uc_taxes/tests/uc_taxes.test

File

uc_attribute/uc_attribute.module, line 767
Ubercart Attribute module.

Code

function uc_attribute_save(&$attribute) {

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