You are here

function _panopoly_core_import_demo_content in Panopoly Core 7

Helpfer function to import demo content for apps using Migrate.

File

./panopoly_core.module, line 296

Code

function _panopoly_core_import_demo_content($classes = array()) {

  // Ensure that migration classes are registered.
  migrate_get_module_apis(TRUE);

  // Process the migrations to import demo content.
  foreach ($classes as $class) {

    // Register the Migration class since auto-registration is not supported
    // since Migrate module version 2.6
    Migration::registerMigration($class);

    // Get a handle on our migration class.
    $migration = Migration::getInstance($class);

    // Disable message output from migrate ince this import is used within
    // the context of the Apps module where these messages make no sense.
    Migration::setDisplayFunction('_panopoly_core_null_message');

    // Process the migration.
    $migration
      ->processImport();
  }
}