Coupon
class Coupon implements CouponInterface
Class Coupon
Properties
| protected int | $id | ||
| protected string|null | $code | Coupon code, passed from promotion | |
| protected int|null | $usageLimit | Maximum number of time coupon can be used, passed from promotion | |
| protected int | $numberOfUses | Number of times coupon has been used | |
| protected bool|null | $used | Coupon has been fully used | |
| protected Promotion | $promotion | Associated promotion | |
| protected User | $user | Associated user |
Methods
No description
No description
Get id
Get code
Set code
Get usage limit
Set usage limit
Get number of times this coupon has been used
Set number of times this coupon has been used
Increment usage
Get associated promotion
Is this coupon valid
(PHP 5 >= 5.1.0)
String representation of object
(PHP 5 >= 5.1.0)
Constructs the object
When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties.
Details
at line 109
User
getUser()
at line 129
int
getNumberOfUses()
at line 139
Coupon
setNumberOfUses(int $numberOfUses)
at line 150
Coupon
useCoupon()
Increase number of uses
at line 166
int
getId()
Get id
at line 174
string
getCode()
Get code
at line 182
CouponInterface
setCode(string $code)
Set code
at line 192
integer
getUsageLimit()
Get usage limit
at line 200
CouponInterface
setUsageLimit(integer $usageLimit)
Set usage limit
at line 210
integer
getUsed()
Get number of times this coupon has been used
at line 218
CouponInterface
setUsed(integer $used)
Set number of times this coupon has been used
at line 228
CouponInterface
incrementUsed()
Increment usage
at line 238
PromotionInterface
getPromotion()
Get associated promotion
at line 246
CouponInterface
setPromotion(PromotionInterface $promotion = null)
Set the associated promotion
at line 256
bool
isValid()
Is this coupon valid
at line 277
string
serialize()
(PHP 5 >= 5.1.0)
String representation of object
at line 297
void
unserialize(string $serialized)
(PHP 5 >= 5.1.0)
Constructs the object
at line 316
mixed
__clone()
When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties.
Any properties that are references to other variables, will remain references. Once the cloning is complete, if a __clone() method is defined, then the newly created object's __clone() method will be called, to allow any necessary properties that need to be changed. NOT CALLABLE DIRECTLY.