public function MigrationBase::saveMessage in Migrate 6.2
Same name and namespace in other branches
- 7.2 includes/base.inc \MigrationBase::saveMessage()
Default to printing messages, but derived classes are expected to save messages indexed by current source ID.
Parameters
string $message: The message to record.
int $level: Optional message severity (defaults to MESSAGE_ERROR).
3 calls to MigrationBase::saveMessage()
- MigrationBase::errorHandler in includes/
base.inc - Custom PHP error handler. TODO: Redundant with hook_watchdog?
- MigrationBase::handleException in includes/
base.inc - Takes an Exception object and both saves and displays it, pulling additional information on the location triggering the exception.
- MigrationBase::loggingCallback in includes/
base.inc - Database logging callback - called when there's a database error. We log non-critical stuff, and throw an exception otherwise TODO: Eliminate in favor of hook_watchdog()?
1 method overrides MigrationBase::saveMessage()
- Migration::saveMessage in includes/
migration.inc - Pass messages through to the map class
File
- includes/
base.inc, line 470 - 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 saveMessage($message, $level = MigrationBase::MESSAGE_ERROR) {
switch ($level) {
case MigrationBase::MESSAGE_ERROR:
$level = 'error';
break;
case MigrationBase::MESSAGE_WARNING:
$level = 'warning';
break;
case MigrationBase::MESSAGE_NOTICE:
$level = 'notice';
break;
case MigrationBase::MESSAGE_INFORMATIONAL:
$level = 'status';
break;
}
self::displayMessage($message, $level);
}