You are here

public function Migration::sourceCount in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 includes/migration.inc \Migration::sourceCount()

Convenience function to return count of total source records

Parameters

boolean $refresh: Pass TRUE to refresh the cached count.

File

includes/migration.inc, line 797
Defines the base class for import/rollback processes.

Class

Migration
The base class for all import objects. This is where most of the smarts of the migrate module resides. Migrations are created by deriving from this class, and in the constructor (after calling parent::__construct()) initializing at a minimum the name,…

Code

public function sourceCount($refresh = FALSE) {
  try {
    $count = $this->source
      ->count($refresh);
  } catch (Exception $e) {
    $count = t('N/A');
    self::displayMessage($e
      ->getMessage());
  }
  return $count;
}