public function MigrateVideoEmbedFieldFieldHandler::prepare in Video Embed Field 7.2
File
- ./
video_embed_field.migrate.inc, line 40 - Migrate support for Video Embed Field module.
Class
- MigrateVideoEmbedFieldFieldHandler
- Custom extended MigrateFieldHandler class for Video Embed Field module.
Code
public function prepare($entity, array $field_info, array $instance, array $values) {
$arguments = array();
if (isset($values['arguments'])) {
$arguments = array_filter($values['arguments']);
unset($values['arguments']);
}
$language = $this
->getFieldLanguage($entity, $field_info, $arguments);
// Setup the standard Field API array for saving.
$delta = 0;
foreach ($values as $value) {
$return[$language][$delta] = array(
'video_url' => $value,
);
$delta++;
}
return isset($return) ? $return : NULL;
}