You are here

protected function MigrateSource::prepareRow in Migrate 6.2

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

Give the calling migration a shot at manipulating, and possibly rejecting, the source row.

Return value

bool FALSE if the row is to be skipped.

1 call to MigrateSource::prepareRow()
MigrateSource::next in includes/source.inc
Implementation of Iterator::next() - subclasses of MigrateSource should implement getNextRow() to retrieve the next valid source rocord to process.

File

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

Class

MigrateSource
Abstract base class for source handling.

Code

protected function prepareRow($row) {
  migrate_instrument_start(get_class($this->activeMigration) . ' prepareRow');
  $return = $this->activeMigration
    ->prepareRow($row);
  migrate_instrument_stop(get_class($this->activeMigration) . ' prepareRow');

  // We're explicitly skipping this row - keep track in the map table
  if ($return === FALSE) {
    $this->activeMigration
      ->getMap()
      ->saveIDMapping($row, array(), MigrateMap::STATUS_IGNORED, $this->activeMigration->rollbackAction);
    $this->numIgnored++;
    $this->currentRow = NULL;
    $this->currentKey = NULL;
  }
  else {
    $return = TRUE;
  }
  $this->numProcessed++;
  return $return;
}