You are here

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

Parameters

array $arguments:

Overrides DrupalMigration::__construct

File

./variable.inc, line 16
Base class for migrating variables into Drupal.

Class

DrupalVariableMigration

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 MigrateDestinationVariable();
  $this->map = new MigrateSQLMap($this->machineName, array(
    'name' => array(
      'description' => 'The name of the variable.',
      'type' => 'varchar',
      'length' => 128,
      'not null' => TRUE,
      'default' => '',
    ),
  ), MigrateDestinationVariable::getKeySchema());
  $this
    ->addFieldMapping('name', 'name');
  $this
    ->addFieldMapping('value', 'value')
    ->callbacks('unserialize');
}