You are here

public function MigrateCountryFieldHandler::prepare in Countries 8

Same name and namespace in other branches
  1. 7.2 countries.migrate.inc \MigrateCountryFieldHandler::prepare()

File

./countries.migrate.inc, line 16
Base integration with the Migrate API class.

Class

MigrateCountryFieldHandler
Custom extended MigrateFieldHandler class.

Code

public function prepare($entity, array $field_info, array $instance, array $values) {
  $arguments = isset($values['arguments']) ? $values['arguments'] : array();
  $language = $this
    ->getFieldLanguage($entity, $field_info, $arguments);
  $delta = 0;
  foreach ($values as $value) {
    $return[$language][$delta]['iso2'] = $value;
    $delta++;
  }
  return isset($return) ? $return : NULL;
}