WellCommerce\Bundle\CouponBundle\Checker\CouponCheckerInterface::getError PHP Method

getError() public method

public getError ( ) : string
return string
    public function getError() : string;

Usage Example

Example #1
0
 /**
  * @param CouponInterface|null $coupon
  *
  * @return bool
  * @throws CouponException
  */
 public function useCoupon(CouponInterface $coupon = null)
 {
     if (!$this->couponChecker->isValid($coupon)) {
         throw new CouponException($this->couponChecker->getError());
     }
     $this->applyCartCoupon($coupon);
     return true;
 }
CouponCheckerInterface