You are here

public function MigrateSQLMap::next in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 plugins/sources/sqlmap.inc \MigrateSQLMap::next()

Implementation of Iterator::next() - called at the bottom of the loop implicitly, as well as explicitly from rewind().

1 call to MigrateSQLMap::next()
MigrateSQLMap::rewind in plugins/sources/sqlmap.inc
Implementation of Iterator::rewind() - called before beginning a foreach loop. TODO: Support idlist, itemlimit.

File

plugins/sources/sqlmap.inc, line 739
Defines a Drupal db-based implementation of MigrateMap.

Class

MigrateSQLMap
@file Defines a Drupal db-based implementation of MigrateMap.

Code

public function next() {
  $this->currentRow = $this->result
    ->fetchObject();
  $this->currentKey = array();
  if (!is_object($this->currentRow)) {
    $this->currentRow = NULL;
  }
  else {
    foreach ($this->sourceKeyMap as $map_field) {
      $this->currentKey[$map_field] = $this->currentRow->{$map_field};

      // Leave only destination fields.
      unset($this->currentRow->{$map_field});
    }
  }
}