You are here

protected function MigrateUpdater::processMigration in GatherContent 8.5

1 call to MigrateUpdater::processMigration()
MigrateUpdater::processMappings in gathercontent_upload/src/Export/MigrateUpdater.php

File

gathercontent_upload/src/Export/MigrateUpdater.php, line 80

Class

MigrateUpdater
Class for handling import/update logic from GatherContent to Drupal.

Namespace

Drupal\gathercontent_upload\Export

Code

protected function processMigration(string $migrationId, array $gcIds) {

  /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
  $migration = $this->migrationService
    ->createInstance($migrationId);
  $source = $migration
    ->getSourcePlugin();
  $source
    ->rewind();
  while ($source
    ->valid()) {
    $row = $source
      ->current();
    $sourceId = $row
      ->getSourceIdValues();
    $sourceId = $sourceId['id'];
    if (empty($gcIds[$sourceId])) {
      $source
        ->next();
      continue;
    }
    $this
      ->processEntity($migration, $gcIds[$sourceId], $row);
    $source
      ->next();
  }
}