/** * @param $id int Coupon ID. */ public function removeCoupon($id) { if (!isset($this->couponData[$id])) { return; } $coupon = $this->couponData[$id]; /** @var Coupon $object */ $object = $coupon['object']; $this->removeDiscount($coupon['discount']); parent::removeCoupon($object->getCode()); unset($this->couponData[$id]); }