You are here

class UcAddressesUcTextFieldHandler in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 handlers/ubercart.handlers.inc \UcAddressesUcTextFieldHandler

Class for an Ubercart core address text field.

Hierarchy

Expanded class hierarchy of UcAddressesUcTextFieldHandler

2 string references to 'UcAddressesUcTextFieldHandler'
uc_addresses_uc_addresses_fields in ./uc_addresses.uc_addresses_fields.inc
Implements hook_uc_addresses_fields().
uc_addresses_uc_addresses_field_handlers in ./uc_addresses.uc_addresses_fields.inc
Implements hook_uc_addresses_field_handlers().

File

handlers/ubercart.handlers.inc, line 43
Field handlers for Ubercart core address fields: first_name, last_name, company, etc.

View source
class UcAddressesUcTextFieldHandler extends UcAddressesUcFieldHandler {

  /**
   * Implements UcAddressesFieldHandler::getFormField().
   */
  public function getFormField($form, $form_values) {
    $fieldName = $this
      ->getFieldName();
    $fieldValue = $this
      ->getAddress()
      ->getField($fieldName);
    $default = isset($form_values[$fieldName]) ? $form_values[$fieldName] : $fieldValue;
    return array(
      $fieldName => array(
        '#type' => 'textfield',
        '#title' => $this
          ->getFieldTitle(),
        '#required' => $this
          ->isFieldRequired(),
        '#default_value' => $default,
        '#size' => 32,
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UcAddressesFieldHandler::$address private property Address object.
UcAddressesFieldHandler::$context private property The context in which this field is used.
UcAddressesFieldHandler::$definition private property The declared field definition.
UcAddressesFieldHandler::$name private property Name of this field.
UcAddressesFieldHandler::checkContext public function Checks if the field passes the context. 1
UcAddressesFieldHandler::getAddress final public function Returns the address attached to this field.
UcAddressesFieldHandler::getContext final public function Returns the context in which this field is used.
UcAddressesFieldHandler::getDefaultValue public function Returns a default value for this field. 3
UcAddressesFieldHandler::getFieldName final public function Returns the field name.
UcAddressesFieldHandler::getMappingTargets public function Returns supported mapping targets for Feeds. 2
UcAddressesFieldHandler::getOutputFormats public function Returns an array of possible output formats the handler supports. 2
UcAddressesFieldHandler::getProperty final public function Returns a property from the field definition.
UcAddressesFieldHandler::getTokenInfo public function Returns supported tokens. 1
UcAddressesFieldHandler::init protected function Can be used by subclasses to do some initialization upon construction of the object. 2
UcAddressesFieldHandler::mapValue public function Set a fields value based on the output format. 2
UcAddressesFieldHandler::outputValue public function Output a field's value. 3
UcAddressesFieldHandler::setValue public function Sets value in the address object.
UcAddressesFieldHandler::validateValue public function Check a fields' value. 2
UcAddressesFieldHandler::__construct final public function UcAddressesFormField object constructor.
UcAddressesUcFieldHandler::getFieldTitle public function Overrides UcAddressesFieldHandler::getFieldTitle(). Overrides UcAddressesFieldHandler::getFieldTitle
UcAddressesUcFieldHandler::isFieldEnabled public function Implements UcAddressesFieldHandler::isFieldEnabled(). Overrides UcAddressesFieldHandler::isFieldEnabled
UcAddressesUcFieldHandler::isFieldRequired public function Implements UcAddressesFieldHandler::isFieldRequired(). Overrides UcAddressesFieldHandler::isFieldRequired
UcAddressesUcTextFieldHandler::getFormField public function Implements UcAddressesFieldHandler::getFormField(). Overrides UcAddressesFieldHandler::getFormField