'state_machine.order_delivery.state_changed' => 'onOrderDeliveryStateChange',
'state_machine.order_transaction.state_changed' => 'onOrderTransactionStateChange',
BusinessEventCollectorEvent::NAME => 'onAddStateEvents',
];
} /**
* @throws OrderException
*/
public function onOrderDeliveryStateChange(StateMachineStateChangeEvent
$event): void
{ $orderDeliveryId =
$event->
getTransition()->
getEntityId();
$criteria =
new Criteria([$orderDeliveryId]);
$criteria->
addAssociation('order.orderCustomer'
);
$criteria->
addAssociation('order.transactions.stateMachineState'
);
/** @var OrderDeliveryEntity|null $orderDelivery */
$orderDelivery =
$this->deliveryRepository
->
search($criteria,
$event->
getContext()) ->
first();
if ($orderDelivery === null
) {