You are here

public function MigrateCountryFieldHandler::prepare in Countries 7.2

Same name and namespace in other branches
  1. 8 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;
}