class PreRowSave 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
- 3.1.x modules/ubercart/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PreRowSave
Same name and namespace in other branches
- 8.2 modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave
- 3.0.x modules/magento/src/EventSubscriber/PreRowSave.php \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave
Handles order and order variation references.
@package \Drupal\commerce_migrate\EventSubscriber
Hierarchy
- class \Drupal\commerce_migrate_magento\EventSubscriber\PreRowSave implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of PreRowSave
1 string reference to 'PreRowSave'
- commerce_migrate_magento.services.yml in modules/
magento/ commerce_migrate_magento.services.yml - modules/magento/commerce_migrate_magento.services.yml
1 service uses PreRowSave
File
- modules/
magento/ src/ EventSubscriber/ PreRowSave.php, line 15
Namespace
Drupal\commerce_migrate_magento\EventSubscriberView source
class PreRowSave implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[MigrateEvents::PRE_ROW_SAVE][] = 'onPreRowSave';
return $events;
}
/**
* Reacts to the PRE_ROW_SAVE event.
*
* @param \Drupal\migrate\Event\MigratePreRowSaveEvent $event
* The migrate pre-row-save event.
*/
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();
}
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PreRowSave:: |
public static | function | ||
PreRowSave:: |
public | function | Reacts to the PRE_ROW_SAVE event. |