You are here

public function AdvancedExampleMigration::__construct in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 migrate_example/wine.inc \AdvancedExampleMigration::__construct()

General initialization of a Migration object.

Overrides Migration::__construct

10 calls to AdvancedExampleMigration::__construct()
WineCommentMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineCommentUpdatesMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineProducerMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineTableMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineTermMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.

... See full list

10 methods override AdvancedExampleMigration::__construct()
WineCommentMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineCommentUpdatesMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineProducerMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineTableMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineTermMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.

... See full list

File

migrate_example/wine.inc, line 19
Advanced migration examples. These serve two purposes:

Class

AdvancedExampleMigration
Abstract intermediate class holding common settings.

Code

public function __construct() {

  // TIP: Migrations can be organized into groups. In this case, all the migrations
  // derived from AdvancedExampleMigration will be part of the 'wine' group.
  // This enables us to easily run just the wine example migrations:
  //  drush migrate-import --group=wine
  // The second argument to MigrateGroup::getInstance is an array of groups
  // which should come before this when viewing migration statuses, or running
  // migration operations using --all. Since the beer migrations in this module
  // did not specify a group, it is in the 'default' group, so this constructor
  // indicates that the wine migrations come after the beer migrations.
  parent::__construct(MigrateGroup::getInstance('wine', array(
    'default',
  )));
  $this->team = array(
    new MigrateTeamMember('Jack Kramer', 'jkramer@example.com', t('Taster')),
    new MigrateTeamMember('Linda Madison', 'lmadison@example.com', t('Winemaker')),
  );
  $this->issuePattern = 'http://drupal.org/node/:id';

  // A format of our own, for testing migration of formats
  $formats = filter_formats();
  foreach ($formats as $format) {
    if ($format->name == 'Migrate example format') {
      $this->basicFormat = $format->format;
      break;
    }
  }
}