return [ CheckoutOrderPlacedEvent::
class => 'orderPlaced',
StateMachineTransitionEvent::
class => 'stateChanged',
PreWriteValidationEvent::
class => 'triggerChangeSet',
OrderEvents::ORDER_LINE_ITEM_WRITTEN_EVENT => 'lineItemWritten',
OrderEvents::ORDER_LINE_ITEM_DELETED_EVENT => 'lineItemWritten',
];
} public function triggerChangeSet(PreWriteValidationEvent
$event): void
{ if ($this->
isDisabled()) { return;
} if ($event->
getContext()->
getVersionId() !== Defaults::LIVE_VERSION
) { return;
} foreach ($event->
getCommands() as $command) { if (!
$command instanceof ChangeSetAware
) { continue;
}