You are here

public function DrupalFile7Migration::__construct in Drupal-to-Drupal data migration 7.2

Required arguments:

source_connection - Connection key for the DatabaseConnection holding the source Drupal installation. source_version - Major version number (as an integer) of the source install. machine_name - Machine name under which a particular migration is registered. description - Description of the migration. group_name - The group (import job) containing this migration (import task).

Optional arguments:

source_database - Array describing the source connection, to be defined in the constructor. If absent, the source connection is assumed to be established elsewhere (typically settings.php). group - Migration group to add this migration to. dependencies - Array of migrations that must be run before this one. soft_dependencies - Array of migrations that should be listed before this one. format_mappings - Array keyed by source format IDs or machine names, with the values being the corresponding D7 machine name. If unspecified, source_options - Array to be passed as options to source constructors, overriding the defaults (map_joinable FALSE, cache_counts TRUE, cache_key derived from the machine name). version_class - The name of a custom DrupalVersion class overriding the default derived from source_version. new_only - For any destination types that support highwater marks or track_changes, suppress that support so repeated migrations only import new items.

Parameters

array $arguments:

Overrides DrupalFileMigration::__construct

2 calls to DrupalFile7Migration::__construct()
DrupalPicture7Migration::__construct in d7/file.inc
Required arguments:
DrupalYoutube7Migration::__construct in d7/file.inc
Required arguments:
2 methods override DrupalFile7Migration::__construct()
DrupalPicture7Migration::__construct in d7/file.inc
Required arguments:
DrupalYoutube7Migration::__construct in d7/file.inc
Required arguments:

File

d7/file.inc, line 18
Implementation of DrupalFileMigration for Drupal 7 sources.

Class

DrupalFile7Migration
Handling specific to a Drupal 7 source for files.

Code

public function __construct(array $arguments) {
  if (isset($arguments['skip_pictures']) && $arguments['skip_pictures']) {
    $this->skipPictures = TRUE;
  }
  parent::__construct($arguments);
  if (!$this->newOnly) {
    $this->highwaterField = array(
      'name' => 'timestamp',
      'alias' => 'f',
      'type' => 'int',
    );
  }
  $this
    ->addFieldMapping('value', 'uri')
    ->callbacks(array(
    $this,
    'fixUri',
  ));
  $this
    ->addFieldMapping('destination_file', 'uri')
    ->callbacks(array(
    $this,
    'fixUri',
  ));
  $this
    ->addFieldMapping('timestamp', 'timestamp');
  $this
    ->addUnmigratedSources(array(
    'status',
  ));
}