Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
backlogRemoveCategory example
$em
=
$eventArgs
->
getEntityManager
(
)
;
$uow
=
$em
->
getUnitOfWork
(
)
;
$this
->pendingAddAssignments =
[
]
;
$this
->pendingRemoveAssignments =
[
]
;
// Entity deletions
foreach
(
$uow
->
getScheduledEntityDeletions
(
)
as
$entity
)
{
if
(
$entity
instanceof Category
)
{
$this
->
backlogRemoveCategory
(
$entity
->
getId
(
)
)
;
}
if
(
$entity
instanceof Article
)
{
$this
->
backlogRemoveArticle
(
$entity
->
getId
(
)
)
;
}
}
// Entity Insertions
foreach
(
$uow
->
getScheduledEntityInsertions
(
)
as
$category
)
{
if
(
!
(
$category
instanceof Category
)
)
{
continue
;
}