CouponRepository
in package
Table of Contents
- $queryBuilder : CI_DB_query_builder
- __construct() : mixed
- getCouponByCode() : CouponEntity
- getCouponById() : CouponEntity
- storeCoupon() : void
- Stores a coupon in database.
- createCouponEntityFromDatabaseRow() : CouponEntity
Properties
$queryBuilder
protected
CI_DB_query_builder
$queryBuilder
Methods
__construct()
public
__construct(CI_DB_query_builder $queryBuilder) : mixed
Parameters
- $queryBuilder : CI_DB_query_builder
Return values
mixed —getCouponByCode()
public
getCouponByCode(string $couponCode) : CouponEntity
Parameters
- $couponCode : string
Tags
Return values
CouponEntity —getCouponById()
public
getCouponById(IdType $couponId) : CouponEntity
Parameters
- $couponId : IdType
Tags
Return values
CouponEntity —storeCoupon()
Stores a coupon in database.
public
storeCoupon(CouponEntity $coupon) : void
If the CouponEntity has a non-empty CouponId, it is assumed to represent an existing record which will be updated, otherwise a new record is created and the CouponId set accordingly.
Parameters
- $coupon : CouponEntity
Return values
void —createCouponEntityFromDatabaseRow()
protected
createCouponEntityFromDatabaseRow(array<string|int, mixed> $couponRow) : CouponEntity
Parameters
- $couponRow : array<string|int, mixed>