Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getStateEventName example
if
(
$orderDelivery
=== null
)
{
throw
OrderException::
orderDeliveryNotFound
(
$orderDeliveryId
)
;
}
if
(
$orderDelivery
->
getOrder
(
)
=== null
)
{
throw
OrderException::
orderDeliveryNotFound
(
$orderDeliveryId
)
;
}
$context
=
$this
->
getContext
(
$orderDelivery
->
getOrderId
(
)
,
$event
->
getContext
(
)
)
;
$order
=
$this
->
getOrder
(
$orderDelivery
->
getOrderId
(
)
,
$context
)
;
$this
->
dispatchEvent
(
$event
->
getStateEventName
(
)
,
$order
,
$context
)
;
}
/** * @throws OrderException */
public
function
onOrderTransactionStateChange
(
StateMachineStateChangeEvent
$event
)
: void
{
$orderTransactionId
=
$event
->
getTransition
(
)
->
getEntityId
(
)
;
$criteria
=
new
Criteria
(
[
$orderTransactionId
]
)
;
$criteria
->
addAssociation
(
'paymentMethod'
)
;