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