You are here

protected function MigrateExecutable::rollbackMessage in Migrate Tools 8.2

Same name and namespace in other branches
  1. 8.5 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::rollbackMessage()
  2. 8 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::rollbackMessage()
  3. 8.3 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::rollbackMessage()
  4. 8.4 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::rollbackMessage()

Emit information on what we've done since the last feedback (or the beginning of this migration).

Parameters

bool $done:

2 calls to MigrateExecutable::rollbackMessage()
MigrateExecutable::onPostRollback in src/MigrateExecutable.php
React to rollback completion.
MigrateExecutable::onPostRowDelete in src/MigrateExecutable.php
React to item rollback.

File

src/MigrateExecutable.php, line 280

Class

MigrateExecutable

Namespace

Drupal\migrate_tools

Code

protected function rollbackMessage($done = TRUE) {
  $rolled_back = $this
    ->getRollbackCount();
  if ($done) {
    $singular_message = "Rolled back 1 item - done with '@name'";
    $plural_message = "Rolled back @numitems items - done with '@name'";
  }
  else {
    $singular_message = "Rolled back 1 item - continuing with '@name'";
    $plural_message = "Rolled back @numitems items - continuing with '@name'";
  }
  $this->message
    ->display(\Drupal::translation()
    ->formatPlural($rolled_back, $singular_message, $plural_message, array(
    '@numitems' => $rolled_back,
    '@name' => $this->migration
      ->id(),
  )));
}