You are here

function uc_attribute_subject_option_exists in Ubercart 6.2

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

Checks if a product/class attribute option exists.

Parameters

$oid: The base attribute option ID.

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

$type: Is this a product or a class?

Return value

TRUE if the attribute option exists.

1 call to uc_attribute_subject_option_exists()
uc_attribute_subject_option_save in uc_attribute/uc_attribute.module
Saves a product/class attribute option.

File

uc_attribute/uc_attribute.module, line 1147

Code

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