public function MigrateDefaultFieldHandler::fields in Migrate 7.2
Implements MigrateFieldHandler::fields().
Parameters
$field_type:
$field_instance:
Return value
array
File
- plugins/
destinations/ fields.inc, line 162 - Support for processing entity fields
Class
- MigrateDefaultFieldHandler
- A fallback field handler to do basic copying of field data.
Code
public function fields($field_type, $field_instance) {
$field_info = field_info_field($field_instance['field_name']);
$fields = array();
$first = TRUE;
foreach ($field_info['columns'] as $column_name => $column_info) {
// The first column is the primary value, which is mapped directly to
// the field name - so, don't include it here among the subfields.
if ($first) {
$first = FALSE;
}
else {
$fields[$column_name] = empty($column_info['description']) ? $column_name : $column_info['description'];
}
}
return $fields;
}