You are here

protected function SyncCommand::execute in FormAssembly 8

File

src/Command/SyncCommand.php, line 66

Class

SyncCommand
FormAssembly Drupal Console Sync Command.

Namespace

Drupal\formassembly\Command

Code

protected function execute(InputInterface $input, OutputInterface $output) {
  $finished = FALSE;
  $batchConfig = [];
  $this->batchProcessor
    ->configureBatch($batchConfig);
  $this->progressBar = $this
    ->getIo()
    ->createProgressBar();
  while (!$finished) {
    $this->batchProcessor
      ->iterateBatch($batchConfig);
    $this->progressBar
      ->advance();
    $finished = $batchConfig['finished'] === 1;
  }
  $this->progressBar
    ->finish();
  $this
    ->getIo()
    ->text($this
    ->trans('commands.formassembly.sync.messages.processing'));
  $this->batchProcessor
    ->batchPostProcess($batchConfig['sandbox']['sync_id']);
  $this
    ->getIo()
    ->success($this
    ->trans('commands.formassembly.sync.messages.success'));
}