$ruleEntity->
setId(Uuid::
randomHex());
$ruleEntity->
setPayload($rules);
return $ruleEntity;
} /**
* Gets a minimum price rule with the provided price value.
*/
private function getMinPriceRule(float
$minPrice): LineItemUnitPriceRule
{ $rule =
new LineItemUnitPriceRule();
$rule->
assign(['amount' =>
$minPrice, 'operator' => LineItemUnitPriceRule::OPERATOR_GTE
]);
return $rule;
} /**
* Gets a minimum quantity rule for the provided line item Id.
*/
private function getMinQuantityRule(string
$itemID, int
$quantity): LineItemWithQuantityRule
{ $rule =
new LineItemWithQuantityRule();