Commit b6ac2efe authored by Matthias Hutterer's avatar Matthias Hutterer
Browse files

Issue #1232028 by Bevan, das-peter: Added support for Migrate package.

parent 0d8b622d
......@@ -5,3 +5,4 @@ package = Fields
files[] = email.module
files[] = email.install
files[] = email.migrate.inc
<?php
/**
* @file
* Support for the Migrate package.
*/
class MigrateEmailFieldHandler extends MigrateFieldHandler {
public function __construct() {
$this->registerTypes(array('email'));
}
public function prepare(stdClass $entity, array $field_info, array $instance, array $values) {
// Setup the Field API array for saving.
$arguments = (isset($values['arguments'])) ? $values['arguments']: array();
$language = $this->getFieldLanguage($entity, $field_info, $arguments);
$delta = 0;
foreach ($values as $value) {
$return[$language][$delta]['email'] = $value;
$delta++;
}
return isset($return) ? $return : NULL;
}
}
......@@ -16,6 +16,13 @@ function email_field_info() {
);
}
/**
* Implements hook_migrate_api().
*/
function email_migrate_api() {
return array('api' => 2);
}
/**
* Implements hook_field_validate().
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment