discount = $discount; parent::__construct($orderFreight, $weight); } public function getKey() { return $this->discount->getCode(); } public function getAmount() { return $this->discount->getAmount(); } /** * @return mixed * @throws \app\common\exceptions\AppException */ function getPrice() { return max($this->orderFreight->getPriceBefore($this->getKey()) - $this->getAmount(),0); } }