class MigrateAddressPhoneFieldHandler in Address Field Phone 7
A Field Handler class that makes address_phone subfield destination for migate api.
Arguments are used to specify all phone related values: 'phone_number', 'phone_number_extension', 'mobile_number', 'fax_number',
Hierarchy
- class \MigrateHandler
- class \MigrateFieldHandler
Expanded class hierarchy of MigrateAddressPhoneFieldHandler
1 string reference to 'MigrateAddressPhoneFieldHandler'
- addressfield_phone_migrate_api in ./
addressfield_phone.migrate.inc - Implements hook_migrate_api().
File
- ./
addressfield_phone.migrate.inc, line 22
View source
class MigrateAddressPhoneFieldHandler extends MigrateAddressFieldHandler {
public function __construct() {
parent::__construct();
}
/**
* Provide subfields for the addressfield columns.
*/
public function fields() {
// Declare our arguments to also be available as subfields.
$fields = array(
'phone_number' => t('Phone Number'),
'phone_number_extension' => t('extension'),
'mobile_number' => t('Mobile Number'),
'fax_number' => t('Fax Number'),
);
return $fields;
}
/**
* Implements MigrateFieldHandler::prepare().
*
* @param $entity
* @param array $field_info
* @param array $instance
* @param array $values
*
* @return null
*/
public function prepare($entity, array $field_info, array $instance, array $values) {
$arguments = array();
if (isset($values['arguments'])) {
$arguments = array_filter($values['arguments']);
unset($values['arguments']);
}
$language = $this
->getFieldLanguage($entity, $field_info, $arguments);
return isset($return) ? $return : NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateAddressFieldHandler:: |
protected | function | Builds an array with additional data for the current $delta. | |
MigrateAddressPhoneFieldHandler:: |
public | function |
Provide subfields for the addressfield columns. Overrides MigrateAddressFieldHandler:: |
|
MigrateAddressPhoneFieldHandler:: |
public | function |
Implements MigrateFieldHandler::prepare(). Overrides MigrateAddressFieldHandler:: |
|
MigrateAddressPhoneFieldHandler:: |
public | function |
Overrides MigrateAddressFieldHandler:: |
|
MigrateFieldHandler:: |
function | Determine the language of the field. | ||
MigrateHandler:: |
protected | property | List of other handler classes which should be invoked before the current one. | |
MigrateHandler:: |
protected | property | List of "types" handled by this handler. Depending on the kind of handler, these may be destination types, field types, etc. | |
MigrateHandler:: |
public | function | ||
MigrateHandler:: |
public | function | ||
MigrateHandler:: |
public | function | Does this handler handle the given type? | 1 |
MigrateHandler:: |
protected | function | Register a list of types handled by this class |