class MigrateFileFieldHandler in Migrate 7.2
Same name and namespace in other branches
- 6.2 plugins/destinations/fields.inc \MigrateFileFieldHandler
Handle for file fields.
Hierarchy
- class \MigrateHandler
- class \MigrateFieldHandler
- class \MigrateFileFieldBaseHandler
- class \MigrateFileFieldHandler
- class \MigrateFileFieldBaseHandler
- class \MigrateFieldHandler
Expanded class hierarchy of MigrateFileFieldHandler
1 string reference to 'MigrateFileFieldHandler'
File
- plugins/
destinations/ fields.inc, line 800 - Support for processing entity fields
View source
class MigrateFileFieldHandler extends MigrateFileFieldBaseHandler {
public function __construct() {
$this
->registerTypes(array(
'file',
));
}
/**
* Implementation of MigrateFieldHandler::fields().
* Note that file and image fields support slightly different field lists.
*
* @param $type
* The file field type - 'file' or 'image'
* @param $instance
* Instance info for the field.
* @param Migration $migration
* The migration context for the parent field. We can look at the mappings
* and determine which subfields are relevant.
*
* @return array
*/
public function fields($type, $instance, $migration = NULL) {
$fields = parent::fields($type, $instance, $migration);
$fields += array(
'description' => t('Subfield: <a href="@doc">String to be used as the description value</a>', array(
'@doc' => 'http://drupal.org/node/1224042#description',
)),
'display' => t('Subfield: <a href="@doc">String to be used as the display value</a>', array(
'@doc' => 'http://drupal.org/node/1224042#display',
)),
);
return $fields;
}
/**
* Implementation of MigrateFileFieldBaseHandler::buildFieldArray().
*/
protected function buildFieldArray($field_array, $arguments, $delta) {
if (isset($arguments['description'])) {
if (is_array($arguments['description'])) {
$field_array['description'] = $arguments['description'][$delta];
}
else {
$field_array['description'] = $arguments['description'];
}
}
else {
$field_array['description'] = '';
}
if (isset($arguments['display'])) {
if (is_array($arguments['display'])) {
$field_array['display'] = $arguments['display'][$delta];
}
else {
$field_array['display'] = $arguments['display'];
}
}
else {
$field_array['display'] = 1;
}
return $field_array;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateFieldHandler:: |
function | Determine the language of the field. | ||
MigrateFileFieldBaseHandler:: |
protected | function | Determine where the migrated file should go. | |
MigrateFileFieldBaseHandler:: |
public | function | Implementation of MigrateFieldHandler::prepare(). | |
MigrateFileFieldHandler:: |
protected | function |
Implementation of MigrateFileFieldBaseHandler::buildFieldArray(). Overrides MigrateFileFieldBaseHandler:: |
|
MigrateFileFieldHandler:: |
public | function |
Implementation of MigrateFieldHandler::fields().
Note that file and image fields support slightly different field lists. Overrides MigrateFileFieldBaseHandler:: |
|
MigrateFileFieldHandler:: |
public | function |
Overrides MigrateHandler:: |
|
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 |