You are here

public static function UcAddressesSchemaAddress::schemaFieldExists in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 class/UcAddressesSchemaAddress.class.php \UcAddressesSchemaAddress::schemaFieldExists()

Returns TRUE if field is part of the schema.

@access public @static

Parameters

string $fieldName: The name of the field whose existence we want to check.

Return value

boolean TRUE if addresses have a field with the given name. FALSE otherwise.

2 calls to UcAddressesSchemaAddress::schemaFieldExists()
UcAddressesSchemaAddress::schemaFieldMustExist in class/UcAddressesSchemaAddress.class.php
Throws an exception if the schema field does not exist.
UcAddressesTestCase::checkAddressValuesInDatabase in tests/UcAddressesTestCase.test
Test if these address values appear in the database.

File

class/UcAddressesSchemaAddress.class.php, line 491
Contains the UcAddressesSchemaAddress class.

Class

UcAddressesSchemaAddress
The schema address class.

Code

public static function schemaFieldExists($fieldName) {
  $schema = drupal_get_schema('uc_addresses');
  if (!empty($schema['fields']) && is_array($schema['fields'])) {
    return isset($schema['fields'][$fieldName]);
  }
  return FALSE;
}