You are here

public function MigrationController::executeStepWithMessages in Workbench Moderation to Content Moderation 8.2

Executes all migrations for a particular step of the wbm2cm process and returns imported counts for each executed migration in a human-friendly format.

Parameters

string $which: The step to execute. Can be one of 'save', 'clear', or 'restore'.

Return value

string[] The imported counts, in a human-friendly format.

File

src/MigrationController.php, line 140

Class

MigrationController

Namespace

Drupal\wbm2cm

Code

public function executeStepWithMessages($which) {
  $messages = [];
  foreach ($this
    ->executeStepWithCounts($which) as $entity_type => $count) {
    $entity_type = $this->entityTypeManager
      ->getDefinition($entity_type);
    $messages[] = $this
      ->t('Processed @count @items.', [
      '@count' => $count,
      '@items' => $this
        ->formatPlural($count, $entity_type
        ->getSingularLabel(), $entity_type
        ->getPluralLabel()),
    ]);
  }
  return array_map('strval', $messages);
}