function __construct($subtotal, Discount $discount) { parent::__construct($discount); $this->subtotal = $subtotal; // for Amount discounts on Subtotals, prevent amount from ever being greater than the Amount if ($discount->Type === "Amount" && $discount->Amount > $this->remaining) { $this->remaining = (double) $this->discount->Amount; $this->limited = true; } }
function __construct(array $infoitems, Discount $discount) { parent::__construct($discount); $this->infoitems = $infoitems; }