You are here

public function MigrateSource::rewind in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 includes/source.inc \MigrateSource::rewind()

Implementation of Iterator::rewind() - subclasses of MigrateSource should implement performRewind() to do any class-specific setup for iterating source records.

File

includes/source.inc, line 256
Define base for migration sources.

Class

MigrateSource
Abstract base class for source handling.

Code

public function rewind() {
  $this->activeMigration = Migration::currentMigration();
  $this->activeMap = $this->activeMigration
    ->getMap();
  $this->numProcessed = 0;
  $this->numIgnored = 0;
  $this->highwaterField = $this->activeMigration
    ->getHighwaterField();
  if (!empty($this->highwaterField)) {
    $this->originalHighwater = $this->activeMigration
      ->getHighwater();
  }
  if ($this->activeMigration
    ->getOption('idlist')) {
    $this->idList = explode(',', $this->activeMigration
      ->getOption('idlist'));
  }
  else {
    $this->idList = array();
  }
  migrate_instrument_start(get_class($this) . ' performRewind');
  $this
    ->performRewind();
  migrate_instrument_stop(get_class($this) . ' performRewind');
  $this
    ->next();
}