Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
hydrateRuleIds example
foreach
(
$event
->
getEvents
(
)
??
[
]
as
$nestedEvent
)
{
if
(
!
$nestedEvent
instanceof EntityWrittenEvent
)
{
continue
;
}
$definition
=
$this
->
getAssociationDefinitionByEntity
(
$associationFields
,
$nestedEvent
->
getEntityName
(
)
)
;
if
(
!
$definition
)
{
continue
;
}
$ruleIds
=
$this
->
hydrateRuleIds
(
$this
->
getForeignKeyFields
(
$definition
)
,
$nestedEvent
,
$ruleIds
)
;
}
if
(
empty
(
$ruleIds
)
)
{
return
;
}
$this
->
update
(
Uuid::
fromBytesToHexList
(
array_unique
(
array_filter
(
$ruleIds
)
)
)
)
;
$this
->cacheInvalidator->
invalidate
(
[
CachedRuleLoader::CACHE_KEY
]
)
;
}