Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDocumentTypeId example
if
(
!
$scope
instanceof FlowRuleScope
)
{
return
false;
}
if
(
!
$documents
=
$scope
->
getOrder
(
)
->
getDocuments
(
)
)
{
return
false;
}
$typeIds
=
[
]
;
foreach
(
$documents
->
getElements
(
)
as
$document
)
{
$typeIds
[
]
=
$document
->
getDocumentTypeId
(
)
;
}
return
RuleComparison::
uuids
(
array_values
(
array_unique
(
$typeIds
)
)
,
$this
->documentIds,
$this
->operator
)
;
}
public
function
getConfig
(
)
: RuleConfig
{
return
(
new
RuleConfig
(
)
)
->
operatorSet
(
RuleConfig::OPERATOR_SET_STRING, true, true
)
->
entitySelectField
(
'documentIds', DocumentTypeDefinition::ENTITY_NAME, true
)
;
}
}