You are here

public function DrupalYoutube7Migration::__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 DrupalFile7Migration::__construct

File

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

Class

DrupalYoutube7Migration
Pull youtube links in their own migration class, based on normal file migration.

Code

public function __construct(array $arguments) {
  $arguments['file_class'] = 'MigrateExtrasFileYoutube';
  parent::__construct($arguments);

  // Clear references to normal file fields
  $this
    ->removeFieldMapping('destination_dir');
  $this
    ->removeFieldMapping('source_dir');
  $this
    ->removeFieldMapping('file_replace');
  $this
    ->removeFieldMapping('preserve_files');
  $this
    ->removeFieldMapping('destination_file');
}