class MigrateLanguagefieldFieldHandler in Custom Language field 7
Migrate field handler for language fields.
Hierarchy
- class \MigrateHandler
- class \MigrateFieldHandler
Expanded class hierarchy of MigrateLanguagefieldFieldHandler
1 string reference to 'MigrateLanguagefieldFieldHandler'
- languagefield_migrate_api in ./
languagefield.module - Implements hook_migrate_api().
File
- ./
languagefield.migrate.inc, line 16 - Contains the MigrateLanguagefieldFieldHandler class.
View source
class MigrateLanguagefieldFieldHandler extends MigrateSimpleFieldHandler {
/**
* {@inheritdoc}
*/
public function __construct() {
parent::__construct();
$this
->registerTypes(array(
'language_field',
));
}
/**
* {@inheritdoc}
*/
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateFieldHandler:: |
function | Determine the language of the field. | ||
MigrateHandler:: |
protected | property | List of other handler classes which should be invoked before the current one. | |
MigrateHandler:: |
protected | property | List of "types" handled by this handler. Depending on the kind of handler, these may be destination types, field types, etc. | |
MigrateHandler:: |
public | function | ||
MigrateHandler:: |
public | function | ||
MigrateHandler:: |
public | function | Does this handler handle the given type? | 1 |
MigrateHandler:: |
protected | function | Register a list of types handled by this class | |
MigrateLanguagefieldFieldHandler:: |
public | function |
Overrides MigrateSimpleFieldHandler:: |
|
MigrateLanguagefieldFieldHandler:: |
public | function |
Construct a simple field handler. Overrides MigrateSimpleFieldHandler:: |
|
MigrateSimpleFieldHandler:: |
protected | property | ||
MigrateSimpleFieldHandler:: |
protected | property | ||
MigrateSimpleFieldHandler:: |
protected | function | Returns TRUE only for values which are not NULL. | 2 |