You are here

public function MigrateExecutable::onMapSave in Migrate Tools 8

Same name and namespace in other branches
  1. 8.5 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
  2. 8.2 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
  3. 8.3 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
  4. 8.4 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()

Count up any map save events.

Parameters

\Drupal\migrate\Event\MigrateMapSaveEvent $event: The map event.

File

src/MigrateExecutable.php, line 117
Contains \Drupal\migrate_tools\MigrateExecutable.

Class

MigrateExecutable

Namespace

Drupal\migrate_tools

Code

public function onMapSave(MigrateMapSaveEvent $event) {
  $fields = $event
    ->getFields();

  // Distinguish between creation and update.
  if ($fields['source_row_status'] == MigrateIdMapInterface::STATUS_IMPORTED && $this->preExistingItem) {
    $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE]++;
  }
  else {
    $this->saveCounters[$fields['source_row_status']]++;
  }
}