public function PreRowSave::onPreRowSave in Commerce Migrate 8.2
Same name in this branch
- 8.2 modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave::onPreRowSave()
- 8.2 modules/ubercart/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PreRowSave::onPreRowSave()
Same name and namespace in other branches
- 3.1.x modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave::onPreRowSave()
- 3.0.x modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave::onPreRowSave()
Reacts to the PRE_ROW_SAVE event.
Parameters
\Drupal\migrate\Event\MigratePreRowSaveEvent $event: The migrate pre-row-save event.
File
- modules/
magento/ src/ EventSubscriber/ PreRowSave.php, line 31
Class
- PreRowSave
- Handles order and order variation references.
Namespace
Drupal\commerce_migrate_magento\EventSubscriberCode
public function onPreRowSave(MigratePreRowSaveEvent $event) {
$migration = $event
->getMigration();
$destination_configuration = $migration
->getDestinationConfiguration();
if ($destination_configuration['plugin'] === 'entity:profile') {
if ($profile_id = $event
->getRow()
->getDestinationProperty('profile_id')) {
if ($profile = Profile::load($profile_id)) {
$profile
->setNewRevision();
}
}
}
}