You are here

function uc_attribute_type_info in Ubercart 6.2

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

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

Parameters

$type: Is this a product or a class?

Return value

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

11 calls to uc_attribute_type_info()
UbercartAttributeTestCase::attributeFieldsToTest in uc_attribute/uc_attribute.test
Returns an array of available fields for product or class attributes.
UbercartAttributeTestCase::attributeOptionFieldsToTest in uc_attribute/uc_attribute.test
Tests the product class attribute option user interface.
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 1162

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',
        'placeholder' => '%d',
      );
      break;
    case 'class':
      return array(
        'attr_table' => '{uc_class_attributes}',
        'opt_table' => '{uc_class_attribute_options}',
        'id' => 'pcid',
        'placeholder' => "'%s'",
      );
      break;
  }
}