You are here

public function MigrateDestinationFile::fields in Migrate 7.2

Returns a list of fields available to be mapped for the entity type (bundle)

Parameters

Migration $migration: Optionally, the migration containing this destination.

Return value

array Keys: machine names of the fields (to be passed to addFieldMapping) Values: Human-friendly descriptions of the fields.

Overrides MigrateDestination::fields

File

plugins/destinations/file.inc, line 593
Support for file entity as destination. Note that File Fields have their own destination in fields.inc

Class

MigrateDestinationFile
Destination class implementing migration into the files table.

Code

public function fields($migration = NULL) {
  $fields = array();

  // First the core properties
  $fields['fid'] = t('Existing file ID');
  $fields['uid'] = t('Uid of user associated with file');
  $fields['value'] = t('Representation of the source file (usually a URI)');
  $fields['timestamp'] = t('UNIX timestamp for the date the file was added');

  // Then add in anything provided by handlers
  $fields += migrate_handler_invoke_all('Entity', 'fields', $this->entityType, $this->bundle, $migration);
  $fields += migrate_handler_invoke_all('File', 'fields', $this->entityType, $this->bundle, $migration);

  // Plus anything provided by the file class
  $fields += call_user_func(array(
    $this->fileClass,
    'fields',
  ));
  return $fields;
}