You are here

class MigrateCountryFieldHandler in Countries 7.2

Same name and namespace in other branches
  1. 8 countries.migrate.inc \MigrateCountryFieldHandler

Custom extended MigrateFieldHandler class.

Hierarchy

Expanded class hierarchy of MigrateCountryFieldHandler

1 string reference to 'MigrateCountryFieldHandler'
countries_migrate_api in ./countries.module
Implements hook_migrate_api().

File

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

View source
class MigrateCountryFieldHandler extends MigrateFieldHandler {
  public function __construct() {
    $this
      ->registerTypes(array(
      'country',
    ));
  }
  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;
  }

}

Members

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