class CouponFactory

Generate a CouponInterface

Methods

__construct( ContainerInterface $container)

Constructor

buildCouponFromCode( string $couponCode)

Build a CouponInterface from its database data

buildCouponFromModel( Coupon $model)

Build a CouponInterface from its Model data contained in the DataBase

Details

at line 46
__construct( ContainerInterface $container)

Constructor

Parameters

ContainerInterface $container Service container

at line 61
CouponInterface buildCouponFromCode( string $couponCode)

Build a CouponInterface from its database data

Parameters

string $couponCode Coupon code ex: XMAS

Return Value

CouponInterface

Exceptions

CouponExpiredException
CouponNoUsageLeftException
CouponNotReleaseException

at line 117
CouponInterface buildCouponFromModel( Coupon $model)

Build a CouponInterface from its Model data contained in the DataBase

Parameters

Coupon $model Database data

Return Value

CouponInterface ready to use CouponInterface object instance