You are here

public function WinePrepMigration::import in Migrate 6.2

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

File

migrate_example/wine.inc, line 82
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');
  }

  // Must return one of the MigrationBase RESULT constants
  return MigrationBase::RESULT_COMPLETED;
}