You are here

class MigrateFieldIpaddressFieldHandler in IP address fields 7

Provides a ipaddress FieldHandler for the Migrate module.

Hierarchy

Expanded class hierarchy of MigrateFieldIpaddressFieldHandler

File

./field_ipaddress.migrate.inc, line 11
Adding support for the Migrate module.

View source
class MigrateFieldIpaddressFieldHandler extends MigrateFieldHandler {
  public function __construct() {
    $this
      ->registerTypes(array(
      'field_ipaddress',
    ));
  }
  public function prepare($entity, array $field_info, array $instance, array $values) {
    $delta = 0;
    foreach ($values as $value) {
      if (!empty($value['start']) && !empty($value['end'])) {
        $return[LANGUAGE_NONE][$delta]['ipaddress']['start'] = $value['start'];
        $return[LANGUAGE_NONE][$delta]['ipaddress']['end'] = $value['end'];
        $delta++;
      }
    }
    return isset($return) ? $return : NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateFieldHandler::getFieldLanguage function Determine the language of the field.
MigrateFieldIpaddressFieldHandler::prepare public function
MigrateFieldIpaddressFieldHandler::__construct public function Overrides MigrateHandler::__construct
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