You are here

public function Migration::isComplete in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 includes/migration.inc \Migration::isComplete()

Reports whether this migration process is complete (i.e., all available source rows have been processed).

Overrides MigrationBase::isComplete

File

includes/migration.inc, line 470
Defines the base class for import/rollback processes.

Class

Migration
The base class for all import objects. This is where most of the smarts of the migrate module resides. Migrations are created by deriving from this class, and in the constructor (after calling parent::__construct()) initializing at a minimum the name,…

Code

public function isComplete() {
  $total = $this
    ->sourceCount(TRUE);

  // If the source is uncountable, we have no way of knowing if it's
  // complete, so stipulate that it is.
  if ($total < 0) {
    return TRUE;
  }
  $processed = $this
    ->processedCount();
  return $total <= $processed;
}