PHP Class Elcodi\Store\CartCouponBundle\EventListener\JustOneManualCouponEventListener

Author: Berny Cantos ([email protected])
Show file Open project: elcodi/bamboo

Protected Properties

Property Type Description
$cartCouponRepository Elcodi\Component\CartCoupon\Repository\CartCouponRepository CartCoupon repository

Public Methods

Method Description
__construct ( Elcodi\Component\CartCoupon\Repository\CartCouponRepository $cartCouponRepository ) Constructor
assertJustOneManualCoupon ( Elcodi\Component\CartCoupon\Event\CartCouponOnApplyEvent $event ) Avoid applying a manual coupon if another is being applied

Protected Methods

Method Description
isManual ( Elcodi\Component\Coupon\Entity\Interfaces\CouponInterface $coupon ) : boolean Check if a coupon has manual enforcement

Method Details

__construct() public method

Constructor
public __construct ( Elcodi\Component\CartCoupon\Repository\CartCouponRepository $cartCouponRepository )
$cartCouponRepository Elcodi\Component\CartCoupon\Repository\CartCouponRepository CartCoupon Repository

assertJustOneManualCoupon() public method

Avoid applying a manual coupon if another is being applied
public assertJustOneManualCoupon ( Elcodi\Component\CartCoupon\Event\CartCouponOnApplyEvent $event )
$event Elcodi\Component\CartCoupon\Event\CartCouponOnApplyEvent

isManual() protected method

Check if a coupon has manual enforcement
protected isManual ( Elcodi\Component\Coupon\Entity\Interfaces\CouponInterface $coupon ) : boolean
$coupon Elcodi\Component\Coupon\Entity\Interfaces\CouponInterface Coupon
return boolean

Property Details

$cartCouponRepository protected property

CartCoupon repository
protected CartCouponRepository,Elcodi\Component\CartCoupon\Repository $cartCouponRepository
return Elcodi\Component\CartCoupon\Repository\CartCouponRepository