ZenMagick 0.9.6


org.zenmagick.model.ZMCoupon

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 2166 2009-04-17 03:26:23Z dermanomann $

Fields inherited from org.zenmagick.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.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

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

getAmount

public float getAmount()

Get the amount.

Returns:
The coupon amount.

getCode

public string getCode()

Get the coupon code.

Returns:
The coupon code.

getDescription

public string getDescription()

Get the coupon description.

Returns:
The coupon description.

getExpiryDate

public string getExpiryDate()

Get the coupon expiry date.

Returns:
The coupon expiry date.

getId

public int getId()

Get the coupon id.

Returns:
The coupon id.

getMinOrderAmount

public float getMinOrderAmount()

Get the minimum order amount.

Returns:
The minimum order amount.

getName

public string getName()

Get the coupon name.

Returns:
The coupon name.

getRestrictions

public array getRestrictions()

Get coupon restrictions.

Returns:
An array of ZMCouponRestriction instances.

getStartDate

public string getStartDate()

Get the coupon start date.

Returns:
The coupon start date.

getType

public string getType()

Get the coupon type.

Returns:
The coupon type.

getUsesPerCoupon

public int getUsesPerCoupon()

Get the uses per coupon.

Returns:
The uses per coupon.

getUsesPerUser

public int getUsesPerUser()

Get the uses per coupon.

Returns:
The uses per coupon.

isActive

public boolean isActive()

Check if this coupon is active.

Returns:
true if this coupon is active.

isFixedAmount

public boolean isFixedAmount()

Check if this a fixed amount coupon.

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

isFreeShipping

public boolean isFreeShipping()

Check if this coupon qualifies for free shipping.

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

isPercentage

public boolean isPercentage()

Check if this a percentage amount coupon.

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

setActive

public void setActive(string active)

Set the active flag.

Parameters:
active - The new flag.

setAmount

public void setAmount(float amount)

Set the amount.

Parameters:
amount - The coupon amount.

setCode

public void setCode(string code)

Set the coupon code.

Parameters:
code - The coupon code.

setDescription

public void setDescription(string description)

Set the coupon description.

Parameters:
description - The coupon description.

setExpiryDate

public void setExpiryDate(string date)

Set the coupon expiry date.

Parameters:
date - The coupon expiry date.

setId

public void setId(int id)

Set the coupon id.

Parameters:
id - The coupon id.

setMinOrderAmount

public void setMinOrderAmount(float amount)

Set the minimum order amount.

Parameters:
amount - The new minimum order amount.

setName

public void setName(string name)

Set the coupon name.

Parameters:
name - The coupon name.

setStartDate

public void setStartDate(string date)

Set the coupon start date.

Parameters:
date - The coupon start date.

setType

public void setType(string type)

Set the coupon type.

Parameters:
type - The coupon type.

setUsesPerCoupon

public void setUsesPerCoupon(int uses)

Set the uses per coupon.

Parameters:
uses - The uses per coupon.

setUsesPerUser

public void setUsesPerUser(int uses)

Set the uses per user.

Parameters:
uses - The uses per user.

ZenMagick 0.9.6