public function MigrateFieldsNodeHandler::fields in Migrate 6.2
File
- plugins/
destinations/ fields.inc, line 13 - Support for processing CCK fields
Class
- MigrateFieldsNodeHandler
- @file Support for processing CCK fields
Code
public function fields($entity_type, $bundle) {
$fields = array();
if (module_exists('content')) {
$content_info = _content_type_info();
foreach ($content_info['content types'][$bundle]['fields'] as $machine_name => $instance) {
$fields[$machine_name] = t('Node:') . ' ' . $instance['widget']['label'] . ' (' . $instance['type'] . ')';
// Look for subfields
$class_list = _migrate_class_list('MigrateFieldHandler');
$disabled = unserialize(variable_get('migrate_disabled_handlers', serialize(array())));
foreach ($class_list as $class_name => $handler) {
if (!in_array($class_name, $disabled) && $handler
->handlesType($instance['type']) && method_exists($handler, 'fields')) {
migrate_instrument_start($class_name . '->fields');
$subfields = call_user_func(array(
$handler,
'fields',
), $instance['type']);
migrate_instrument_stop($class_name . '->fields');
foreach ($subfields as $subfield_name => $subfield_label) {
$fields[$machine_name . ':' . $subfield_name] = $subfield_label;
}
}
}
}
}
return $fields;
}