You are here

public function MigrateCommerceFileFieldHandler::fields in Commerce File 7

Implementation of MigrateFieldHandler::fields().

Parameters

$type: The file field type - 'file' or 'image'

$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

Overrides MigrateFileFieldBaseHandler::fields

File

migrate/destinations/fields.inc, line 28
Support for processing commerce file fields

Class

MigrateCommerceFileFieldHandler
Handle for commerce_file fields;

Code

public function fields($type, $instance, $migration = NULL) {
  $fields = parent::fields($type, $instance, $migration);

  // remove file field sub fields
  unset($fields['description'], $fields['display']);

  // add limit data
  $data_fields = array();
  $license_info = _commerce_file_collate_license_info();
  foreach ($license_info as $data_key => $data_info) {
    $fields[$data_key] = t('Subfield: Access limit for @title', array(
      '@title' => isset($data_info['title']) ? $data_info['title'] : $data_key,
    ));
  }
  return $fields;
}