public function PreRowSave::onPreRowSave in Commerce Migrate 3.1.x
Same name in this branch
- 3.1.x modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave::onPreRowSave()
- 3.1.x modules/ubercart/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PreRowSave::onPreRowSave()
Same name and namespace in other branches
- 8.2 modules/ubercart/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PreRowSave::onPreRowSave()
- 3.0.x modules/ubercart/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PreRowSave::onPreRowSave()
Reacts to the PRE_ROW_SAVE event.
If the profile exists, then set it as a new revision.
Parameters
\Drupal\migrate\Event\MigratePreRowSaveEvent $event: The event object.
File
- modules/
ubercart/ src/ EventSubscriber/ PreRowSave.php, line 34
Class
- PreRowSave
- Handles order and order variation references.
Namespace
Drupal\commerce_migrate_ubercart\EventSubscriberCode
public function onPreRowSave(MigratePreRowSaveEvent $event) {
$migration = $event
->getMigration();
$source_plugin = $migration
->getSourcePlugin();
if (is_a($source_plugin, ProfileBilling::class)) {
if ($profile_id = $event
->getRow()
->getDestinationProperty('profile_id')) {
if ($profile = ProfileEntity::load($profile_id)) {
$profile
->setNewRevision();
}
}
}
}