/** * {@inheritdoc} */ public function addPromotionCoupon(BaseCouponInterface $coupon = null) { if (null === $coupon) { return; } if (!$this->hasPromotionCoupon($coupon)) { $this->promotionCoupons->add($coupon); } }
/** * {@inheritdoc} */ public function addPromotionCoupon($coupon) { if (null === $coupon) { return $this; } if (!$coupon instanceof BaseCouponInterface) { throw new UnexpectedTypeException($coupon, 'Sylius\\Component\\Promotion\\Model\\CouponInterface'); } if (!$this->hasPromotionCoupon($coupon)) { $this->promotionCoupons->add($coupon); } return $this; }
/** * {@inheritdoc} */ public function addPromotionCoupon($coupon) { if (null === $coupon) { return $this; } if (!$coupon instanceof BaseCouponInterface) { throw new UnexpectedTypeException($coupon, CouponInterface::class); } if (!$this->hasPromotionCoupon($coupon)) { $this->promotionCoupons->add($coupon); } return $this; }