You are here

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

Parameters

array $arguments:

Overrides DrupalMigration::__construct

2 calls to DrupalCustomBlockMigration::__construct()
DrupalCustomBlock5Migration::__construct in d5/block_custom.inc
DrupalCustomBlock6Migration::__construct in d6/block_custom.inc
2 methods override DrupalCustomBlockMigration::__construct()
DrupalCustomBlock5Migration::__construct in d5/block_custom.inc
DrupalCustomBlock6Migration::__construct in d6/block_custom.inc

File

./block_custom.inc, line 15
Base class for migrating custom blocks into Drupal.

Class

DrupalCustomBlockMigration

Code

public function __construct(array $arguments) {
  parent::__construct($arguments);

  // Create our three main objects - source, destination, and map
  $this->source = new MigrateSourceSQL($this
    ->query(), $this->sourceFields, NULL, $this->sourceOptions);
  $this->destination = new MigrateDestinationCustomBlock();
  $this->map = new MigrateSQLMap($this->machineName, array(
    'bid' => array(
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
      'description' => "The block's {block}.bid.",
    ),
  ), MigrateDestinationCustomBlock::getKeySchema());

  // The mappings are straightforward
  $this
    ->addSimpleMappings(array(
    'body',
    'info',
  ));
  $this
    ->addFieldMapping('format', 'format')
    ->callbacks(array(
    $this,
    'mapFormat',
  ));
}