public function PreRowSave::onPreRowSave in Commerce Migrate 3.0.x
Same name in this branch
- 3.0.x modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave::onPreRowSave()
- 3.0.x modules/ubercart/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PreRowSave::onPreRowSave()
Same name and namespace in other branches
- 8.2 modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave::onPreRowSave()
- 3.1.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();
}
}
}
}