Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getWrittenEntitiesByEvent example
$writes
= EntityWrittenContainerEvent::
createWithWrittenEvents
(
$result
->
getWritten
(
)
,
$context
,
[
]
)
;
$deletes
= EntityWrittenContainerEvent::
createWithDeletedEvents
(
$result
->
getDeleted
(
)
,
$context
,
[
]
)
;
if
(
$deletes
->
getEvents
(
)
!== null
)
{
$writes
->
addEvent
(
...
$deletes
->
getEvents
(
)
->
getElements
(
)
)
;
}
$this
->eventDispatcher->
dispatch
(
$writes
)
;
$ids
=
$this
->
getWrittenEntities
(
$result
->
getWritten
(
)
)
;
$deleted
=
$this
->
getWrittenEntitiesByEvent
(
$deletes
)
;
$notFound
=
$this
->
getWrittenEntities
(
$result
->
getNotFound
(
)
)
;
return
new
SyncResult
(
$ids
,
$notFound
,
$deleted
)
;
}
/** * @param array<string, EntityWriteResult[]> $grouped * * @return array<string, array<int, mixed>> */