Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
updateCustomer example
return
;
}
if
(
$event
->
getEntityName
(
)
!== 'order'
)
{
return
;
}
if
(
$event
->
getToPlace
(
)
->
getTechnicalName
(
)
!== OrderStates::STATE_COMPLETED &&
$event
->
getFromPlace
(
)
->
getTechnicalName
(
)
!== OrderStates::STATE_COMPLETED
)
{
return
;
}
$this
->
updateCustomer
(
[
$event
->
getEntityId
(
)
]
)
;
}
public
function
deleteOrder
(
PreWriteValidationEvent
$event
)
: void
{
if
(
$event
->
getContext
(
)
->
getVersionId
(
)
!== Defaults::LIVE_VERSION
)
{
return
;
}
$orderIds
=
[
]
;
foreach
(
$event
->
getCommands
(
)
as
$command
)
{
if
(
$command
->
getDefinition
(
)
->
getClass
(
)
=== OrderDefinition::
class