You are here

function uc_addresses_load_class in Ubercart Addresses 6.2

Automatically load classes from Ubercart Addresses.

Parameters

string $class: The class file to be loaded.

Return value

boolean TRUE if the class was loaded. FALSE otherwise.

1 string reference to 'uc_addresses_load_class'
uc_addresses.module in ./uc_addresses.module
Adds user profile address support to Ubercart.

File

./uc_addresses.module, line 1589
Adds user profile address support to Ubercart.

Code

function uc_addresses_load_class($class) {
  if (strpos($class, 'UcAddress') !== FALSE) {
    if (strpos($class, 'Exception') !== FALSE) {

      // Load the Exception classes.
      return module_load_include('inc', 'uc_addresses', 'class/Exceptions');
    }
    else {

      // Load an UcAddresses class.
      return module_load_include('class.php', 'uc_addresses', 'class/' . $class);
    }
  }
  return FALSE;
}