You are here

public function MigrateSourceSQL::getNextRow in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 plugins/sources/sql.inc \MigrateSourceSQL::getNextRow()

Implementation of MigrateSource::getNextRow().

Return value

object

File

plugins/sources/sql.inc, line 438
Define a MigrateSource for importing from Drupal connections.

Class

MigrateSourceSQL
Implementation of MigrateSource, to handle imports from Drupal connections.

Code

public function getNextRow() {
  $row = $this->result
    ->fetchObject();

  // We might be out of data entirely, or just out of data in the current
  // batch. Attempt to fetch the next batch and see.
  if (!is_object($row) && $this->batchSize > 0) {
    $this
      ->getNextBatch();
    $row = $this->result
      ->fetchObject();
  }
  if (is_object($row)) {
    return $row;
  }
  else {
    return NULL;
  }
}