$hasRange = true;
} if ($current <
$reference) { $reference =
$current;
$cheapest =
$price;
} } // @codeCoverageIgnoreEnd
$object =
new CheapestPrice();
$object->
setRuleId($cheapest['rule_id'
]);
$object->
setVariantId($cheapest['variant_id'
]);
$object->
setParentId($cheapest['parent_id'
]);
$object->
setHasRange($hasRange);
$object->
setPurchase($cheapest['purchase_unit'
] ?
(float) $cheapest['purchase_unit'
] : null
);
$object->
setReference($cheapest['reference_unit'
] ?
(float) $cheapest['reference_unit'
] : null
);
$object->
setUnitId($cheapest['unit_id'
] ?? null
);
$prices =
[];
$blueprint =
new Price('', 1, 1, true
);