PHP Class WellCommerce\Bundle\CouponBundle\Checker\CouponChecker

Author: Adam Piotrowski ([email protected])
Inheritance: implements WellCommerce\Bundle\CouponBundle\Checker\CouponCheckerInterface
Show file Open project: wellcommerce/wellcommerce

Public Methods

Method Description
__construct ( WellCommerce\Bundle\OrderBundle\Repository\OrderRepositoryInterface $orderRepository ) CouponChecker constructor.
getError ( ) : string
isValid ( WellCommerce\Bundle\CouponBundle\Entity\CouponInterface $coupon = null ) : boolean

Private Methods

Method Description
isNotExpired ( WellCommerce\Bundle\CouponBundle\Entity\CouponInterface $coupon ) : boolean Checks whether the coupon is not expired
isStartDateValid ( WellCommerce\Bundle\CouponBundle\Entity\CouponInterface $coupon ) : boolean Checks whether the coupon's start date is valid

Method Details

__construct() public method

CouponChecker constructor.
public __construct ( WellCommerce\Bundle\OrderBundle\Repository\OrderRepositoryInterface $orderRepository )
$orderRepository WellCommerce\Bundle\OrderBundle\Repository\OrderRepositoryInterface

getError() public method

public getError ( ) : string
return string

isValid() public method

public isValid ( WellCommerce\Bundle\CouponBundle\Entity\CouponInterface $coupon = null ) : boolean
$coupon WellCommerce\Bundle\CouponBundle\Entity\CouponInterface
return boolean