You are here

public function Migrator::generatePreMigrationMessage in Lightning Workflow 8.3

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

Generates a message to be shown before migrating a set of entity types.

Parameters

\Drupal\Core\Entity\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 332

Class

Migrator
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) {
  $entity_types = $this
    ->entityTypeOptions($entity_types);
  $variables = [
    '@entity_types' => Element::oxford($entity_types),
    ':maintenance_mode' => Url::fromRoute('system.site_maintenance_mode')
      ->toString(),
  ];
  return $html ? $this
    ->t('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.', $variables) : $this
    ->t('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. You cannot undo this, so you may want to back up your database and switch to maintenance mode before continuing.', $variables);
}