public function MigrationBase::getLastImported in Migrate 6.2
Same name and namespace in other branches
- 7.2 includes/base.inc \MigrationBase::getLastImported()
Retrieve the last time an import operation completed successfully.
Return value
string Date/time string, formatted... How? Default DB server format?
File
- includes/
base.inc, line 607 - Defines the base class for migration processes.
Class
- MigrationBase
- The base class for all objects representing distinct steps in a migration process. Most commonly these will be Migration objects which actually import data from a source into a Drupal destination, but by deriving classes directly from MigrationBase…
Code
public function getLastImported() {
$last_imported = db_select('migrate_log', 'ml')
->fields('ml', array(
'endtime',
))
->condition('machine_name', $this->machineName)
->isNotNull('endtime')
->orderBy('endtime', 'DESC')
->execute()
->fetchField();
if ($last_imported) {
$last_imported = date('Y-m-d H:i:s', $last_imported / 1000);
}
else {
$last_imported = '';
}
return $last_imported;
}