You are here

public function MigrationBase::getStatus in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 includes/base.inc \MigrationBase::getStatus()

Check the current status of a migration.

Return value

int One of the MigrationBase::STATUS_* constants

2 calls to MigrationBase::getStatus()
Migration::checkStatus in includes/migration.inc
Standard top-of-loop stuff, common between rollback and import - check for exceptional conditions, and display feedback.
MigrationBase::beginProcess in includes/base.inc
Begin a process, ensuring only one process can be active at once on a given migration.

File

includes/base.inc, line 782
Defines the base class for migration processes.

Class

MigrationBase
The base class for all objects representing distinct steps in a migration process. Most commonly these will be Migration objects which actually import data from a source into a Drupal destination, but by deriving classes directly from MigrationBase…

Code

public function getStatus() {
  if (!$this->enabled) {
    return MigrationBase::STATUS_DISABLED;
  }
  $status = db_select('migrate_status', 'ms')
    ->fields('ms', array(
    'status',
  ))
    ->condition('machine_name', $this->machineName)
    ->execute()
    ->fetchField();
  if (!isset($status)) {
    $status = MigrationBase::STATUS_IDLE;
  }
  return $status;
}