public function MigrateLanguagefieldFieldHandler::prepare in Custom Language field 7
Overrides MigrateSimpleFieldHandler::prepare
File
- ./
languagefield.migrate.inc, line 29 - Contains the MigrateLanguagefieldFieldHandler class.
Class
- MigrateLanguagefieldFieldHandler
- Migrate field handler for language fields.
Code
public function prepare($entity, array $field_info, array $instance, array $values) {
// Get the options for this field.
$options = languagefield_options_list($field_info, $instance, $entity->type, $entity);
// Filter out values that are not in the options.
$values = array_intersect($values, array_keys($options));
return parent::prepare($entity, $field_info, $instance, $values);
}