class UcAddressesUcTextFieldHandler in Ubercart Addresses 6.2
Same name and namespace in other branches
- 7 handlers/ubercart.handlers.inc \UcAddressesUcTextFieldHandler
Class for an Ubercart core address text field.
Hierarchy
- class \UcAddressesFieldHandler
- class \UcAddressesUcFieldHandler
Expanded class hierarchy of UcAddressesUcTextFieldHandler
2 string references to 'UcAddressesUcTextFieldHandler'
- uc_addresses_uc_addresses_fields in ./
uc_addresses.uc_addresses_fields.inc - Implementation of hook_uc_addresses_fields().
- uc_addresses_uc_addresses_field_handlers in ./
uc_addresses.uc_addresses_fields.inc - Implementation of 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UcAddressesFieldHandler:: |
private | property | Address object. | |
UcAddressesFieldHandler:: |
private | property | The context in which this field is used. | |
UcAddressesFieldHandler:: |
private | property | The declared field definition. | |
UcAddressesFieldHandler:: |
private | property | Name of this field. | |
UcAddressesFieldHandler:: |
public | function | Checks if the field passes the context. | 1 |
UcAddressesFieldHandler:: |
final public | function | Returns the address attached to this field. | |
UcAddressesFieldHandler:: |
final public | function | Returns the context in which this field is used. | |
UcAddressesFieldHandler:: |
public | function | Returns a default value for this field. | 3 |
UcAddressesFieldHandler:: |
final public | function | Returns the field name. | |
UcAddressesFieldHandler:: |
public | function | Returns an array of possible output formats the handler supports. | 3 |
UcAddressesFieldHandler:: |
final public | function | Returns a property from the field definition. | |
UcAddressesFieldHandler:: |
protected | function | Can be used by subclasses to do some initialization upon construction of the object. | 2 |
UcAddressesFieldHandler:: |
public | function | Output a field's value. | 3 |
UcAddressesFieldHandler:: |
public | function | Sets value in the address object. | |
UcAddressesFieldHandler:: |
public | function | Check a fields' value. | 2 |
UcAddressesFieldHandler:: |
final public | function | UcAddressesFormField object constructor. | |
UcAddressesUcFieldHandler:: |
public | function |
Overrides UcAddressesFieldHandler::getFieldTitle(). Overrides UcAddressesFieldHandler:: |
|
UcAddressesUcFieldHandler:: |
public | function |
Implements UcAddressesFieldHandler::isFieldEnabled(). Overrides UcAddressesFieldHandler:: |
|
UcAddressesUcFieldHandler:: |
public | function |
Implements UcAddressesFieldHandler::isFieldRequired(). Overrides UcAddressesFieldHandler:: |
|
UcAddressesUcTextFieldHandler:: |
public | function |
Implements UcAddressesFieldHandler::getFormField(). Overrides UcAddressesFieldHandler:: |