You are here

public function MigrateFieldIpaddressFieldHandler::prepare in IP address fields 7

File

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

Class

MigrateFieldIpaddressFieldHandler
Provides a ipaddress FieldHandler for the Migrate module.

Code

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;
}