You are here

public function MigrateSQLMap::errorCount in Migrate 7.2

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

Get the number of source records which failed to import.

Return value

int Number of records errored out.

Overrides MigrateMap::errorCount

File

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

Class

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

Code

public function errorCount() {
  $query = $this->connection
    ->select($this->mapTable);
  $query
    ->addExpression('COUNT(*)', 'count');
  $query
    ->condition('needs_update', MigrateMap::STATUS_FAILED);
  $count = $query
    ->execute()
    ->fetchField();
  return $count;
}