You are here

protected function Sql::countHelper in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/src/Plugin/migrate/id_map/Sql.php \Drupal\migrate\Plugin\migrate\id_map\Sql::countHelper()

Counts records in a table.

Parameters

$status: An integer for the source_row_status column.

$table: The table to work

Return value

int The number of records.

3 calls to Sql::countHelper()
Sql::errorCount in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
Returns the number of items that failed to import.
Sql::messageCount in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
Returns the number of messages saved.
Sql::updateCount in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
Returns a count of items which are marked as needing update.

File

core/modules/migrate/src/Plugin/migrate/id_map/Sql.php, line 652
Contains \Drupal\migrate\Plugin\migrate\id_map\Sql.

Class

Sql
Defines the sql based ID map implementation.

Namespace

Drupal\migrate\Plugin\migrate\id_map

Code

protected function countHelper($status, $table = NULL) {
  $query = $this
    ->getDatabase()
    ->select($table ?: $this
    ->mapTableName());
  if (isset($status)) {
    $query
      ->condition('source_row_status', $status);
  }
  return $query
    ->countQuery()
    ->execute()
    ->fetchField();
}