You are here

public function Migrator::generatePreMigrationMessage in Lightning Workflow 8.2

Same name and namespace in other branches
  1. 8.3 modules/lightning_scheduler/src/Migrator.php \Drupal\lightning_scheduler\Migrator::generatePreMigrationMessage()

Generates an informational message to be displayed before starting the migration for a set of entity types.

Parameters

EntityTypeInterface[] $entity_types: The entity types that will be migrated.

bool $html: Whether to include HTML tags in the message.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The generated message.

File

modules/lightning_scheduler/src/Migrator.php, line 334

Class

Migrator
This class is final because the migration is not an API and should not be extended or re-used.

Namespace

Drupal\lightning_scheduler

Code

public function generatePreMigrationMessage(array $entity_types, $html = TRUE) {
  $message = 'You are about to migrate scheduled transitions for all @entity_types. This will modify your existing content and may take a long time if you have a huge site with tens of thousands of pieces of content. <strong>You cannot undo this</strong>, so you may want to <strong>back up your database</strong> and <a href=":maintenance_mode">switch to maintenance mode</a> before continuing.';
  if ($html == FALSE) {
    $message = strip_tags($message);
  }
  $variables = [
    '@entity_types' => Element::oxford($this
      ->entityTypeOptions($entity_types)),
    ':maintenance_mode' => Url::fromRoute('system.site_maintenance_mode')
      ->toString(),
  ];
  return $this
    ->t($message, $variables);
}