return [ 'promotionCodeType' => RuleConstraints::
string(),
'operator' => RuleConstraints::
stringOperators(false
),
];
} public function getConfig(): RuleConfig
{ return (new RuleConfig()) ->
operatorSet(RuleConfig::OPERATOR_SET_STRING
) ->
selectField('promotionCodeType',
['global', 'fixed', 'individual'
]);
} private function lineItemMatches(LineItem
$lineItem): bool
{ if ($this->promotionCodeType === null
) { return false;
} $promotionCodeType =
$lineItem->
getPayloadValue('promotionCodeType'
);
return RuleComparison::
string($promotionCodeType,
$this->promotionCodeType,
$this->operator
);
}