Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
filterForFlow example
if
(
!
$event
->
hasData
(
OrderAware::ORDER
)
)
{
return
\
in_array
(
$ruleId
,
$event
->
getContext
(
)
->
getRuleIds
(
)
, true
)
;
}
$order
=
$event
->
getData
(
OrderAware::ORDER
)
;
if
(
!
$order
instanceof OrderEntity
)
{
return
\
in_array
(
$ruleId
,
$event
->
getContext
(
)
->
getRuleIds
(
)
, true
)
;
}
$rule
=
$this
->ruleLoader->
load
(
$event
->
getContext
(
)
)
->
filterForFlow
(
)
->
get
(
$ruleId
)
;
if
(
!
$rule
|| !
$rule
->
getPayload
(
)
instanceof Rule
)
{
return
\
in_array
(
$ruleId
,
$event
->
getContext
(
)
->
getRuleIds
(
)
, true
)
;
}
return
$rule
->
getPayload
(
)
->
match
(
$this
->scopeBuilder->
build
(
$order
,
$event
->
getContext
(
)
)
)
;
}
}