ZenMagick 0.9.8


org.zenmagick.store.model.ZMCoupon
\store\model\ZMCoupon.php at line 38

Class ZMCoupon

ZMObject
└─ZMCoupon

public class ZMCoupon
extends ZMObject

A single coupon.

NOTE: Depending on the coupon type, not all values might be set.

For example, gift vouchers do only have a code and amount.

Author:
DerManoMann
Version:
$Id: ZMCoupon.php 2694 2009-12-03 22:32:18Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMCoupon(int id, string code, string type)

Create new instance

Method Summary
float

getAmount()

Get the amount.

string

getCode()

Get the coupon code.

string

getDescription()

Get the coupon description.

string

getExpiryDate()

Get the coupon expiry date.

int

getId()

Get the coupon id.

float

getMinOrderAmount()

Get the minimum order amount.

string

getName()

Get the coupon name.

array

getRestrictions()

Get coupon restrictions.

string

getStartDate()

Get the coupon start date.

string

getType()

Get the coupon type.

int

getUsesPerCoupon()

Get the uses per coupon.

int

getUsesPerUser()

Get the uses per coupon.

boolean

isActive()

Check if this coupon is active.

boolean

isFixedAmount()

Check if this a fixed amount coupon.

boolean

isFreeShipping()

Check if this coupon qualifies for free shipping.

boolean

isPercentage()

Check if this a percentage amount coupon.

void

setActive(string active)

Set the active flag.

void

setAmount(float amount)

Set the amount.

void

setCode(string code)

Set the coupon code.

void

setDescription(string description)

Set the coupon description.

void

setExpiryDate(string date)

Set the coupon expiry date.

void

setId(int id)

Set the coupon id.

void

setMinOrderAmount(float amount)

Set the minimum order amount.

void

setName(string name)

Set the coupon name.

void

setStartDate(string date)

Set the coupon start date.

void

setType(string type)

Set the coupon type.

void

setUsesPerCoupon(int uses)

Set the uses per coupon.

void

setUsesPerUser(int uses)

Set the uses per user.

Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\store\model\ZMCoupon.php at line 59

ZMCoupon

public ZMCoupon(int id, string code, string type)

Create new instance

Parameters:
id - The coupon id; default is 0.
code - The coupon code; default is ''.
type - The coupon type; default is ''.

Method Detail

\store\model\ZMCoupon.php at line 104

getAmount

public float getAmount()

Get the amount.

Returns:
The coupon amount.

\store\model\ZMCoupon.php at line 90

getCode

public string getCode()

Get the coupon code.

Returns:
The coupon code.

\store\model\ZMCoupon.php at line 118

getDescription

public string getDescription()

Get the coupon description.

Returns:
The coupon description.

\store\model\ZMCoupon.php at line 139

getExpiryDate

public string getExpiryDate()

Get the coupon expiry date.

Returns:
The coupon expiry date.

\store\model\ZMCoupon.php at line 83

getId

public int getId()

Get the coupon id.

Returns:
The coupon id.

\store\model\ZMCoupon.php at line 125

getMinOrderAmount

public float getMinOrderAmount()

Get the minimum order amount.

Returns:
The minimum order amount.

\store\model\ZMCoupon.php at line 111

getName

public string getName()

Get the coupon name.

Returns:
The coupon name.

\store\model\ZMCoupon.php at line 188

getRestrictions

public array getRestrictions()

Get coupon restrictions.

Returns:
An array of ZMCouponRestriction instances.

\store\model\ZMCoupon.php at line 132

getStartDate

public string getStartDate()

Get the coupon start date.

Returns:
The coupon start date.

\store\model\ZMCoupon.php at line 97

getType

public string getType()

Get the coupon type.

Returns:
The coupon type.

\store\model\ZMCoupon.php at line 146

getUsesPerCoupon

public int getUsesPerCoupon()

Get the uses per coupon.

Returns:
The uses per coupon.

\store\model\ZMCoupon.php at line 153

getUsesPerUser

public int getUsesPerUser()

Get the uses per coupon.

Returns:
The uses per coupon.

\store\model\ZMCoupon.php at line 167

isActive

public boolean isActive()

Check if this coupon is active.

Returns:
true if this coupon is active.

\store\model\ZMCoupon.php at line 174

isFixedAmount

public boolean isFixedAmount()

Check if this a fixed amount coupon.

Returns:
true if this coupon has a fixed amount assigned, false if not.

\store\model\ZMCoupon.php at line 160

isFreeShipping

public boolean isFreeShipping()

Check if this coupon qualifies for free shipping.

Returns:
true if this coupon qualifies for free shipping, false if not.

\store\model\ZMCoupon.php at line 181

isPercentage

public boolean isPercentage()

Check if this a percentage amount coupon.

Returns:
true if this coupon has a percentage amount assigned, false if not.

\store\model\ZMCoupon.php at line 274

setActive

public void setActive(string active)

Set the active flag.

Parameters:
active - The new flag.

\store\model\ZMCoupon.php at line 218

setAmount

public void setAmount(float amount)

Set the amount.

Parameters:
amount - The coupon amount.

\store\model\ZMCoupon.php at line 204

setCode

public void setCode(string code)

Set the coupon code.

Parameters:
code - The coupon code.

\store\model\ZMCoupon.php at line 232

setDescription

public void setDescription(string description)

Set the coupon description.

Parameters:
description - The coupon description.

\store\model\ZMCoupon.php at line 253

setExpiryDate

public void setExpiryDate(string date)

Set the coupon expiry date.

Parameters:
date - The coupon expiry date.

\store\model\ZMCoupon.php at line 197

setId

public void setId(int id)

Set the coupon id.

Parameters:
id - The coupon id.

\store\model\ZMCoupon.php at line 239

setMinOrderAmount

public void setMinOrderAmount(float amount)

Set the minimum order amount.

Parameters:
amount - The new minimum order amount.

\store\model\ZMCoupon.php at line 225

setName

public void setName(string name)

Set the coupon name.

Parameters:
name - The coupon name.

\store\model\ZMCoupon.php at line 246

setStartDate

public void setStartDate(string date)

Set the coupon start date.

Parameters:
date - The coupon start date.

\store\model\ZMCoupon.php at line 211

setType

public void setType(string type)

Set the coupon type.

Parameters:
type - The coupon type.

\store\model\ZMCoupon.php at line 260

setUsesPerCoupon

public void setUsesPerCoupon(int uses)

Set the uses per coupon.

Parameters:
uses - The uses per coupon.

\store\model\ZMCoupon.php at line 267

setUsesPerUser

public void setUsesPerUser(int uses)

Set the uses per user.

Parameters:
uses - The uses per user.

ZenMagick 0.9.8