You are here

class MigratePhoneFieldHandler in Party 7

Same name and namespace in other branches
  1. 8.2 starterkits/party_starterkit_b2b/party_starterkit_b2b_migrate/party_starterkit_b2b_migrate_organizations.inc \MigratePhoneFieldHandler

Hierarchy

Expanded class hierarchy of MigratePhoneFieldHandler

File

starterkits/party_starterkit_b2b/party_starterkit_b2b_migrate/party_starterkit_b2b_migrate_organizations.inc, line 8
Support for migrate module

View source
class MigratePhoneFieldHandler extends MigrateFieldHandler {
  public function __construct() {
    $this
      ->registerTypes(array(
      'phone',
    ));
  }
  public function prepare($entity, array $field_info, array $instance, array $values) {
    if (isset($values['arguments'])) {
      $arguments = $values['arguments'];
      unset($values['arguments']);
    }
    else {
      $arguments = array();
    }
    $language = $this
      ->getFieldLanguage($entity, $field_info, $arguments);
    foreach ($values as $delta => $value) {
      $item = array();
      $item['value'] = $value;
      $return[$language][$delta] = $item;
      $delta++;
    }
    return isset($return) ? $return : NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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
MigratePhoneFieldHandler::prepare public function
MigratePhoneFieldHandler::__construct public function Overrides MigrateHandler::__construct