Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDeleteBacklog example
return
[
Events::onFlush, Events::postFlush
]
;
}
public
function
onFlush
(
OnFlushEventArgs
$eventArgs
)
{
$em
=
$eventArgs
->
getEntityManager
(
)
;
$uow
=
$em
->
getUnitOfWork
(
)
;
// Entity deletions
foreach
(
$uow
->
getScheduledEntityDeletions
(
)
as
$entity
)
{
$backlog
=
$this
->
getDeleteBacklog
(
$entity
)
;
if
(
!
$backlog
)
{
continue
;
}
$this
->queue
[
]
=
$backlog
;
}
// Entity Insertions
foreach
(
$uow
->
getScheduledEntityInsertions
(
)
as
$entity
)
{
$this
->inserts
[
]
=
$entity
;
}