You are here

protected function MigrateExecutable::progressMessage in Migrate Tools 8.4

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.2 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::progressMessage()
  4. 8.3 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::progressMessage()

Emit information on what we've done.

Either since the last feedback or the beginning of this migration.

Parameters

bool $done: TRUE if this is the last items to process. Otherwise FALSE.

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 260

Class

MigrateExecutable
Defines a migrate executable class for drush.

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, [
    '@numitems' => $processed,
    '@created' => $this
      ->getCreatedCount(),
    '@updated' => $this
      ->getUpdatedCount(),
    '@failures' => $this
      ->getFailedCount(),
    '@ignored' => $this
      ->getIgnoredCount(),
    '@name' => $this->migration
      ->id(),
  ]));
}