You are here

public static function Migration::runPoolExport in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 2.1.x src/Controller/Migration.php \Drupal\cms_content_sync\Controller\Migration::runPoolExport()
2 calls to Migration::runPoolExport()
Migration::runActiveStep in src/Controller/Migration.php
MigrationForm::submitForm in src/Form/MigrationForm.php
Form submission handler.

File

src/Controller/Migration.php, line 191

Class

Migration
Migration Embed provides methods and a UI to migrate from Content Sync v1 to Content Sync v2.

Namespace

Drupal\cms_content_sync\Controller

Code

public static function runPoolExport($machine_names = null) {
  self::useV2(true);
  foreach (Pool::getAll() as $pool) {
    if ($machine_names ? in_array($pool
      ->id(), $machine_names) : !$pool
      ->v2Ready()) {
      $exporter = new SyncCorePoolExport($pool);
      $batch = $exporter
        ->prepareBatch(true);
      $batch
        ->executeAll();
      self::setPoolV2Ready($pool);
    }
  }
  \Drupal::messenger()
    ->addMessage(t('Successfully exported your Pools to the new Sync Core v2.'));
}