MagicSmoke  $VERSION$
WOVoucher Class Reference
Inheritance diagram for WOVoucher:
WOVoucherAbstract WObject WOVoucherAudit

Public Member Functions

 isStillValid ()
 returns true if the voucher is currently valid More...
 
 updatedValidity ()
 returns a timestamp to be stored for updating the validity period upon use of the voucher More...
 
- Public Member Functions inherited from WOVoucherAbstract
 __construct ()
 
 getisused ()
 
 getorderid ()
 
 getprice ()
 
 getstatus ()
 
 getstr_isused ()
 
 getstr_orderid ()
 
 getstr_price ()
 
 getstr_status ()
 
 getstr_tags ()
 
 getstr_validtime ()
 
 getstr_value ()
 
 getstr_voucherid ()
 
 gettags ()
 
 getvalidtime ()
 
 getvalue ()
 
 getvoucherid ()
 
 propertyArray ()
 
 setisused ($value)
 
 setorderid ($value)
 
 setprice ($value)
 
 setstatus ($value)
 
 settags ($value)
 
 setvalidtime ($value)
 
 setvalue ($value)
 
 setvoucherid ($value)
 
 toString ()
 
 toTablevoucher (&$table)
 
 toXml ($xml, $elementname="Voucher")
 
- Public Member Functions inherited from WObject
 propertyArray ()
 base for property array More...
 

Static Public Member Functions

static calculateInitialValidity ()
 calculates an initial validity date and returns it as timestamp More...
 
static calculateUpdatedValidity ($time)
 returns a timestamp to be stored for updating the validity period upon use of the voucher More...
 
static getTransactionComment ()
 helper for audit table creation More...
 
static GetVoucherAuditTransaction ($trans)
 implements the GetVoucherAudit transaction More...
 
static validVoucherPrices ()
 returns all valid voucher prices More...
 
- Static Public Member Functions inherited from WOVoucherAbstract
static fromString ($txt)
 
static fromTableArrayvoucher (array $table)
 
static fromTablevoucher ($table)
 
static fromXml ($xml, $elem)
 
static validateisused ($value)
 
static validateorderid ($value)
 
static validateprice ($value)
 
static validatestatus ($value)
 
static validatetags ($value)
 
static validatevalidtime ($value)
 
static validatevalue ($value)
 
static validatevoucherid ($value)
 
- Static Public Member Functions inherited from WObject
static elementsByTagName ($root, $tag)
 helper function that returns only the elements directly beneith the one given as $root More...
 
static fromXmlBoolean ($str)
 helper function for XML'ized objects that transforms XML boolean to PHP boolean More...
 
static isXmlBoolean ($str)
 helper function for XML'ized objects: it returns whether the string is a valid boolean More...
 

Additional Inherited Members

- Public Attributes inherited from WOVoucherAbstract
const InvalidPrice =2
 
const InvalidTime =3
 
const InvalidValue =1
 
const Ok =0
 
- Protected Member Functions inherited from WOVoucherAbstract
 toXmlHelper ($xml, $root)
 
- Protected Member Functions inherited from WObject
 __construct ()
 
 toXmlHelper ($xml, $root)
 base for serialization More...
 
- Static Protected Member Functions inherited from WOVoucherAbstract
static fromXmlHelper ($data, $xml, $elem)
 
- Static Protected Member Functions inherited from WObject
static fromXmlHelper ($data, $xml, $elem)
 base for deserialization More...
 
static objectToArray ($obj)
 helper function for classy objects that calls getPropertyArray if available More...
 
- Protected Attributes inherited from WOVoucherAbstract
 $prop_isused =null
 
 $prop_orderid =null
 
 $prop_price =null
 
 $prop_status =null
 
 $prop_tags =null
 
 $prop_validtime =null
 
 $prop_value =null
 
 $prop_voucherid =null
 

Member Function Documentation

static WOVoucher::calculateInitialValidity ( )
static

calculates an initial validity date and returns it as timestamp

References $VoucherInitAdd, $VoucherInitDate, and $VoucherInitStart.

static WOVoucher::calculateUpdatedValidity (   $time)
static

returns a timestamp to be stored for updating the validity period upon use of the voucher

Parameters
$timethe current timestamp
Returns
the new timestamp to be stored in the DB

References $VoucherUseAdd, $VoucherUseDate, and $VoucherUseStart.

static WOVoucher::getTransactionComment ( )
static

helper for audit table creation

References WobTransactionBase\getInstance().

Referenced by WTvoucher_audit\newKey().

static WOVoucher::GetVoucherAuditTransaction (   $trans)
static

implements the GetVoucherAudit transaction

References $db, WOVoucherAudit\fromTableArrayvoucher_audit(), and WTvoucher_audit\selectFromDB().

Referenced by WTrGetVoucherAudit\handleRequest().

WOVoucher::isStillValid ( )

returns true if the voucher is currently valid

References WOVoucherAbstract\getvalidtime().

WOVoucher::updatedValidity ( )

returns a timestamp to be stored for updating the validity period upon use of the voucher

References WOVoucherAbstract\getvalidtime().

static WOVoucher::validVoucherPrices ( )
static

returns all valid voucher prices

References $db.

Referenced by WOWebCart\addVoucher(), and WTrGetValidVoucherPrices\handleRequest().


The documentation for this class was generated from the following file: