class MigrateSafewordFieldHandler in Safeword 7
Same name and namespace in other branches
- 8 safeword.migrate.inc \MigrateSafewordFieldHandler
Custom extended MigrateFieldHandler class for the Safeword module.
Hierarchy
- class \MigrateHandler
- class \MigrateFieldHandler
- class \MigrateSafewordFieldHandler
- class \MigrateFieldHandler
Expanded class hierarchy of MigrateSafewordFieldHandler
1 string reference to 'MigrateSafewordFieldHandler'
- safeword_migrate_api in ./
safeword.migrate.inc - Implements hook_migrate_api().
File
- ./
safeword.migrate.inc, line 43 - Support for migrate module.
View source
class MigrateSafewordFieldHandler extends MigrateFieldHandler {
public function __construct() {
$this
->registerTypes(array(
'safeword_title',
));
}
public function prepare($entity, array $field_info, array $instance, array $values) {
// Change the format of the arguments for getFieldLanguage().
$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.
foreach (array_values($values) as $delta => $value) {
$item = array();
if (isset($arguments['machine'])) {
$item['machine'] = $arguments['machine'];
}
$item['human'] = $value;
$return[$language][$delta] = $item;
}
return isset($return) ? $return : NULL;
}
}
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 | |
MigrateSafewordFieldHandler:: |
public | function | ||
MigrateSafewordFieldHandler:: |
public | function |
Overrides MigrateHandler:: |