function uc_attribute_subject_option_load in Ubercart 6.2
Same name and namespace in other branches
- 8.4 uc_attribute/uc_attribute.module \uc_attribute_subject_option_load()
- 7.3 uc_attribute/uc_attribute.module \uc_attribute_subject_option_load()
Loads a product/class attribute option.
Parameters
$oid: The product/class attribute option ID.
$type: Is this a product or a class?
$id: The product/class ID.
Return value
An object containing the product/class attribute option.
2 calls to uc_attribute_subject_option_load()
- UbercartAttributeTestCase::testAttributeUIAttributeOptionsBulkEdit in uc_attribute/
uc_attribute.test - Tests the "bulk edit attribute options" user interface.
- UbercartAttributeTestCase::testAttributeUIClassAttributeOptionOverview in uc_attribute/
uc_attribute.test - Tests the product class attribute option user interface.
File
- uc_attribute/
uc_attribute.module, line 992
Code
function uc_attribute_subject_option_load($oid, $type, $id) {
$sql = uc_attribute_type_info($type);
$result = db_query("\n SELECT po.{$sql['id']}, po.oid, po.cost, po.price, po.weight, po.ordering, ao.name,\n ao.aid\n FROM {$sql['opt_table']} AS po\n LEFT JOIN {uc_attribute_options} AS ao ON po.oid = ao.oid\n WHERE po.oid = %d AND\n po.{$sql['id']} = {$sql['placeholder']}\n ORDER BY po.ordering, ao.name", $oid, $id);
return db_fetch_object($result);
}