You are here

function uc_attribute_subject_exists in Ubercart 6.2

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

Checks if a product/class attribute exists.

Parameters

$aid: The base attribute ID.

$id: The product/class attribute's ID.

$type: Is this a product or a class?

Return value

TRUE if the attribute exists.

2 calls to uc_attribute_subject_exists()
UbercartAttributeTestCase::testAttributeAPI in uc_attribute/uc_attribute.test
Tests the basic attribute API.
uc_attribute_subject_save in uc_attribute/uc_attribute.module
Saves a product/class attribute.

File

uc_attribute/uc_attribute.module, line 1129

Code

function uc_attribute_subject_exists($aid, $type, $id) {
  $sql = uc_attribute_type_info($type);
  return FALSE !== db_result(db_query("SELECT aid FROM {$sql['attr_table']} WHERE aid = %d AND {$sql['id']} = {$sql['placeholder']}", $aid, $id));
}