email.migrate.inc 674 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * @file
  4. * Support for the Migrate package.
  5. */
  6. class MigrateEmailFieldHandler extends MigrateFieldHandler {
  7. public function __construct() {
  8. $this->registerTypes(array('email'));
  9. }
  10. public function prepare(stdClass $entity, array $field_info, array $instance, array $values) {
  11. // Setup the Field API array for saving.
  12. $arguments = (isset($values['arguments'])) ? $values['arguments']: array();
  13. $language = $this->getFieldLanguage($entity, $field_info, $arguments);
  14. $delta = 0;
  15. foreach ($values as $value) {
  16. $return[$language][$delta]['email'] = $value;
  17. $delta++;
  18. }
  19. return isset($return) ? $return : NULL;
  20. }
  21. }