public function MigrateExecutable::onMapSave in Migrate Tools 8.3
Same name and namespace in other branches
- 8.5 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
- 8 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
- 8.2 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
- 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 120
Class
Namespace
Drupal\migrate_toolsCode
public function onMapSave(MigrateMapSaveEvent $event) {
// Only count saves for this migration.
if ($event
->getMap()
->getQualifiedMapTableName() == $this->migration
->getIdMap()
->getQualifiedMapTableName()) {
$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']]++;
}
}
}