You are here

protected function MigrateExecutable::progressMessage in Migrate Tools 8.2

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

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

Parameters

bool $done:

2 calls to MigrateExecutable::progressMessage()
MigrateExecutable::onPostImport in src/MigrateExecutable.php
React to migration completion.
MigrateExecutable::onPrepareRow in src/MigrateExecutable.php
React to a new row.

File

src/MigrateExecutable.php, line 243

Class

MigrateExecutable

Namespace

Drupal\migrate_tools

Code

protected function progressMessage($done = TRUE) {
  $processed = $this
    ->getProcessedCount();
  if ($done) {
    $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'";
    $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'";
  }
  else {
    $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'";
    $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'";
  }
  $this->message
    ->display(\Drupal::translation()
    ->formatPlural($processed, $singular_message, $plural_message, array(
    '@numitems' => $processed,
    '@created' => $this
      ->getCreatedCount(),
    '@updated' => $this
      ->getUpdatedCount(),
    '@failures' => $this
      ->getFailedCount(),
    '@ignored' => $this
      ->getIgnoredCount(),
    '@name' => $this->migration
      ->id(),
  )));
}