You are here

public function WinePrepMigration::import in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 migrate_example/wine.inc \WinePrepMigration::import()

File

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

Class

WinePrepMigration
TIP: While usually you'll create true migrations - processes that copy data from some source into Drupal - you can also define processing steps for either the import or rollback stages that take other actions. In this case, we want to disable…

Code

public function import() {
  if (module_exists('auto_nodetitle')) {
    self::$wasEnabled = TRUE;
    module_disable(array(
      'auto_nodetitle',
    ));
    self::displayMessage(t('Disabled auto_nodetitle module'), 'success');
  }
  else {
    self::$wasEnabled = FALSE;
    self::displayMessage(t('Auto_nodetitle is already disabled'), 'success');
  }

  // import() must return one of the MigrationBase RESULT constants.
  return MigrationBase::RESULT_COMPLETED;
}