public function MigrateExecutable::onMapSave in Migrate Tools 8
Same name and namespace in other branches
- 8.5 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
- 8.2 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::onMapSave()
- 8.3 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 117 - Contains \Drupal\migrate_tools\MigrateExecutable.
Class
Namespace
Drupal\migrate_toolsCode
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']]++;
}
}