You are here

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

Parameters

array $arguments:

Overrides ExampleNodeMigration::__construct

File

migrate_d2d_example/node.inc, line 19

Class

ExampleImageMigration
Image-specific mappings and handling.

Code

public function __construct(array $arguments) {

  // Add any other data we're pulling into the source row, before the parent
  // constructor.
  $this->sourceFields['copyright'] = 'Media copyright notice';
  $this->sourceFields['filename'] = 'Path of image within mounted filesystem';
  parent::__construct($arguments);
  $this
    ->addFieldMapping('field_credit', 'copyright');
  $this
    ->addFieldMapping('field_main_image', 'filename');
  $this
    ->addFieldMapping('field_main_image:source_path')
    ->defaultValue('/mnt/source_images');
}