Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function addPromotionCoupon(BaseCouponInterface $coupon = null)
 {
     if (null === $coupon) {
         return;
     }
     if (!$this->hasPromotionCoupon($coupon)) {
         $this->promotionCoupons->add($coupon);
     }
 }
Beispiel #2
0
 /**
  * {@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;
 }
Beispiel #3
0
 /**
  * {@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;
 }