You are here

public function MigrateSQLMap::rewind in Migrate 7.2

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

Implementation of Iterator::rewind() - called before beginning a foreach loop. TODO: Support idlist, itemlimit.

File

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

Class

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

Code

public function rewind() {
  $this->currentRow = NULL;
  $fields = array();
  foreach ($this->sourceKeyMap as $field) {
    $fields[] = $field;
  }
  foreach ($this->destinationKeyMap as $field) {
    $fields[] = $field;
  }
  $this->result = $this->connection
    ->select($this->mapTable, 'map')
    ->fields('map', $fields)
    ->execute();
  $this
    ->next();
}