function uc_class_get_attributes in Ubercart 7.3
Same name and namespace in other branches
- 8.4 uc_attribute/uc_attribute.module \uc_class_get_attributes()
- 5 uc_attribute/uc_attribute.module \uc_class_get_attributes()
- 6.2 uc_attribute/uc_attribute.module \uc_class_get_attributes()
Loads all attributes associated with a product class.
Parameters
int $pcid: The product class id.
Return value
array The attributes.
2 calls to uc_class_get_attributes()
- uc_object_attributes_form in uc_attribute/
uc_attribute.admin.inc - Form to associate attributes with products or classes.
- uc_object_options_form in uc_attribute/
uc_attribute.admin.inc - Form to assign and modify attribute options on products or classes.
File
- uc_attribute/
uc_attribute.module, line 1185 - Ubercart Attribute module.
Code
function uc_class_get_attributes($pcid) {
$attributes = array();
$result = db_query("SELECT uca.aid FROM {uc_class_attributes} uca LEFT JOIN {uc_attributes} ua ON uca.aid = ua.aid WHERE uca.pcid = :type ORDER BY uca.ordering, ua.name", array(
':type' => $pcid,
));
foreach ($result as $attribute) {
$attributes[$attribute->aid] = uc_attribute_load($attribute->aid, $pcid, 'class');
}
return $attributes;
}