You are here

public function MigrateSQLMap::getRowsNeedingUpdate in Migrate 7.2

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

Retrieve an array of map rows marked as needing update.

Parameters

int $count: Maximum rows to return; defaults to 10,000.

Return value

array Array of map row objects with needs_update==1.

Overrides MigrateMap::getRowsNeedingUpdate

File

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

Class

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

Code

public function getRowsNeedingUpdate($count) {
  $rows = array();
  $result = $this->connection
    ->select($this->mapTable, 'map')
    ->fields('map')
    ->condition('needs_update', MigrateMap::STATUS_NEEDS_UPDATE)
    ->range(0, $count)
    ->execute();
  foreach ($result as $row) {
    $rows[] = $row;
  }
  return $rows;
}