abstract class MigrateFieldHandler in Migrate 7.2
Same name and namespace in other branches
- 6.2 plugins/destinations/fields.inc \MigrateFieldHandler
Hierarchy
- class \MigrateHandler
- class \MigrateFieldHandler
Expanded class hierarchy of MigrateFieldHandler
3 string references to 'MigrateFieldHandler'
- MigrateFieldsEntityHandler::fields in plugins/
destinations/ fields.inc - Implementation of MigrateDestinationHandler::fields().
- migrate_field_handler_invoke_all in ./
migrate.module - Invoke any available handlers attached to a given field type.
- migrate_ui_configure_form in migrate_ui/
migrate_ui.pages.inc - Form for reviewing migrations.
File
- plugins/
destinations/ fields.inc, line 111 - Support for processing entity fields
View source
abstract class MigrateFieldHandler extends MigrateHandler {
// Derived classes are expected to implement one
// or both of the prepare/complete handlers.
// Abstract public function
// prepare($entity, array $field_info, array $instance, array $values).
// Abstract public function
// complete($entity, array $field_info, array $instance, array $values).
/**
* Determine the language of the field.
*
* @param $entity
* @param $field_info
* @param $arguments
*
* @return string language code.
*/
function getFieldLanguage($entity, $field_info, array $arguments) {
$migration = Migration::currentMigration();
switch (TRUE) {
case !field_is_translatable($migration
->getDestination()
->getEntityType(), $field_info):
return LANGUAGE_NONE;
case isset($arguments['language']):
return $arguments['language'];
case !empty($entity->language) && $entity->language != LANGUAGE_NONE:
return $entity->language;
break;
default:
return $migration
->getDestination()
->getLanguage();
}
}
}
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 | |
MigrateHandler:: |
abstract public | function | 11 |