You are here

final public function UcAddressesFieldHandler::__construct in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 handlers/UcAddressesFieldHandler.class.php \UcAddressesFieldHandler::__construct()

UcAddressesFormField object constructor.

@final @access public

Parameters

string $name: The name of the address field.

UcAddressesSchemaAddress $address: Instance of UcAddressesSchemaAddress.

string $context: The context in which this field is used.

Return value

void

File

handlers/UcAddressesFieldHandler.class.php, line 70
Contains the UcAddressesFieldHandler class.

Class

UcAddressesFieldHandler
Base class for fields used in Ubercart Addresses.

Code

public final function __construct($name, UcAddressesSchemaAddress $address, $context = 'default') {
  $this->name = $name;
  $this->address = $address;
  if ($context) {
    $this->context = (string) $context;
  }
  else {
    $this->context = 'default';
  }

  // Load the definition for this field.
  $fields = uc_addresses_get_address_fields();
  if (isset($fields[$this->name])) {
    $this->definition = $fields[$this->name];
  }
  else {
    $this->definition = array();
  }

  // Perform eventually further initialization.
  $this
    ->init();
}