function Migration::allRowsProcessed

Same name and namespace in other branches
  1. 9 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::allRowsProcessed()
  2. 8.9.x core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::allRowsProcessed()
  3. 11.x core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::allRowsProcessed()

Check if all source rows from this migration have been processed.

Return value

bool TRUE if this migration is complete otherwise FALSE.

Overrides MigrationInterface::allRowsProcessed

File

core/modules/migrate/src/Plugin/Migration.php, line 583

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

public function allRowsProcessed() {
  $source_count = $this->getSourcePlugin()
    ->count();
  // If the source is uncountable, we have no way of knowing if it's
  // complete, so stipulate that it is.
  if ($source_count < 0) {
    return TRUE;
  }
  $processed_count = $this->getIdMap()
    ->processedCount();
  // We don't use == because in some circumstances (like unresolved stubs
  // being created), the processed count may be higher than the available
  // source rows.
  return $source_count <= $processed_count;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.