You are here

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

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

Namesort descending Modifiers Type Description Overrides
MigrateAddressFieldHandler::prepareArguments protected function Builds an array with additional data for the current $delta.
MigrateAddressPhoneFieldHandler::fields public function Provide subfields for the addressfield columns. Overrides MigrateAddressFieldHandler::fields
MigrateAddressPhoneFieldHandler::prepare public function Implements MigrateFieldHandler::prepare(). Overrides MigrateAddressFieldHandler::prepare
MigrateAddressPhoneFieldHandler::__construct public function Overrides MigrateAddressFieldHandler::__construct
MigrateFieldHandler::getFieldLanguage function Determine the language of the field.
MigrateHandler::$dependencies protected property List of other handler classes which should be invoked before the current one.
MigrateHandler::$typesHandled protected property List of "types" handled by this handler. Depending on the kind of handler, these may be destination types, field types, etc.
MigrateHandler::getDependencies public function
MigrateHandler::getTypesHandled public function
MigrateHandler::handlesType public function Does this handler handle the given type? 1
MigrateHandler::registerTypes protected function Register a list of types handled by this class