You are here

public function MigrateTextFieldHandler::fields in Migrate 7.2

Implementation of MigrateFieldHandler::fields().

Parameters

$type: The field type.

$instance: Instance info for the field.

Migration $migration: The migration context for the parent field. We can look at the mappings and determine which subfields are relevant.

Return value

array

File

plugins/destinations/fields.inc, line 349
Support for processing entity fields

Class

MigrateTextFieldHandler

Code

public function fields($type, $instance, $migration = NULL) {
  $fields = array();
  if ($type == 'text_with_summary') {
    $fields['summary'] = t('Subfield: <a href="@doc">Summary of field contents</a>', array(
      '@doc' => 'http://drupal.org/node/1224042#summary',
    ));
  }
  if ($instance['settings']['text_processing']) {
    $fields['format'] = t('Subfield: <a href="@doc">Text format for the field</a>', array(
      '@doc' => 'http://drupal.org/node/1224042#format',
    ));
  }
  $field = field_info_field($instance['field_name']);
  if (field_is_translatable($instance['entity_type'], $field)) {
    $fields['language'] = t('Subfield: <a href="@doc">Language for the field</a>', array(
      '@doc' => 'http://drupal.org/node/1224042#language',
    ));
  }
  return $fields;
}