public function MigrateExecutable::onMapSave in Migrate Tools 8.5
Same name and namespace in other branches
- 8 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 129
Class
- MigrateExecutable
- Defines a migrate executable class for drush.
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();
$this->itemLimitCounter++;
// 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']]++;
}
}
}