You are here

function uc_attribute_type_info in Ubercart 7.3

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

Returns a list of names to abstract queries between products and classes.

Parameters

string $type: Is this a product or a class?

Return value

array Array of information helpful for creating SQL queries dealing with attributes.

11 calls to uc_attribute_type_info()
UbercartAttributeTestCase::attributeFieldsToTest in uc_attribute/tests/uc_attribute.test
Returns an array of available fields for product or class attributes.
UbercartAttributeTestCase::attributeOptionFieldsToTest in uc_attribute/tests/uc_attribute.test
Returns array of available fields for product or class attribute options.
uc_attribute_load in uc_attribute/uc_attribute.module
Loads an attribute from the database.
uc_attribute_load_multiple in uc_attribute/uc_attribute.module
Loads attribute objects from the database.
uc_attribute_subject_delete in uc_attribute/uc_attribute.module
Deletes an attribute and all options associated with it.

... See full list

File

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

Code

function uc_attribute_type_info($type) {
  switch ($type) {
    case 'product':
      return array(
        'attr_table' => 'uc_product_attributes',
        'opt_table' => 'uc_product_options',
        'id' => 'nid',
      );
    case 'class':
      return array(
        'attr_table' => 'uc_class_attributes',
        'opt_table' => 'uc_class_attribute_options',
        'id' => 'pcid',
      );
  }
}