discount = $discount; parent::__construct($orderGoodsPrice, $discount->getWeight()); } function getKey() { return $this->discount->getCode(); } /** * @return float|int|mixed * @throws \app\common\exceptions\AppException */ function getPrice() { return $this->orderGoodsPrice->getPriceBefore($this->getKey()) - $this->discount->getAmount(); } }