oxVoucher Class Reference

Inheritance diagram for oxVoucher:

Inheritance graph
[legend]
Collaboration diagram for oxVoucher:

Collaboration graph
[legend]

List of all members.


Detailed Description

Voucher manager. Performs deletion, generating, assigning to group and other voucher managing functions.

Public Member Functions

 __construct ()
 getVoucherByNr ($voucherNr, $aVouchers=array(), $blCheckavalability=false)
 markAsUsed ($sOrderId, $sUserId)
 markAsReserved ()
 unMarkAsReserved ()
 getDiscountValue ($dPrice)
 checkVoucherAvailability ($aVouchers, $dPrice)
 checkBasketVoucherAvailability ($aVouchers, $dPrice)
 checkUserAvailability ($oUser)
 getSimpleVoucher ()
 getSerie ()

Protected Member Functions

 _isAvailablePrice ($dPrice)
 _isAvailableWithSameSeries ($aVouchers)
 _isAvailableWithOtherSeries ($aVouchers)
 _isValidDate ()
 _isNotReserved ()
 _isAvailableInOtherOrder ($oUser)
 _isValidUserGroup ($oUser)

Protected Attributes

 $_blDisableShopCheck = true
 $_sClassName = 'oxvoucher'

Private Attributes

 $_oSerie = null

Constructor & Destructor Documentation

oxVoucher.__construct (  ) 

Class constructor, initiates parent constructor (parent.oxBase()).

Reimplemented from oxBase.


Member Function Documentation

oxVoucher.getVoucherByNr ( voucherNr,
aVouchers = array(),
blCheckavalability = false 
)

Gets voucher from db by given number.

Parameters:
string $voucherNr Voucher number
array $aVouchers Array of available vouchers (default array())
bool $blCheckavalability ()
Exceptions:
oxVoucherException exception
Returns:
mixed

oxVoucher.markAsUsed ( sOrderId,
sUserId 
)

marks voucher as used

Parameters:
string $sOrderId order id
string $sUserId user id
Returns:
null

oxVoucher.markAsReserved (  ) 

mark voucher as reserved

Returns:
null

oxVoucher.unMarkAsReserved (  ) 

unmark as reserved

Returns:
null

oxVoucher.getDiscountValue ( dPrice  ) 

Returns the discount value used.

Parameters:
double $dPrice price to calculate discount on it
Exceptions:
oxVoucherException exception
Returns:
double

oxVoucher.checkVoucherAvailability ( aVouchers,
dPrice 
)

Checks availability without user logged in. Returns array with errors.

Parameters:
array $aVouchers array of vouchers
double $dPrice current sum (price)
Exceptions:
oxVoucherException exception
Returns:
array

oxVoucher.checkBasketVoucherAvailability ( aVouchers,
dPrice 
)

Performs basket level voucher availability check (no need to check if voucher is reserved or so).

Parameters:
array $aVouchers array of vouchers
double $dPrice current sum (price)
Exceptions:
oxVoucherException exception
Returns:
array

oxVoucher._isAvailablePrice ( dPrice  )  [protected]

Checks availability about price. Returns error array.

Parameters:
double $dPrice base article price
Exceptions:
oxVoucherException exception
Returns:
array

oxVoucher._isAvailableWithSameSeries ( aVouchers  )  [protected]

Checks if cumulation with vouchers of the same series possible. Returns true on success.

Parameters:
array $aVouchers array of vouchers
Exceptions:
oxVoucherException exception
Returns:
bool

oxVoucher._isAvailableWithOtherSeries ( aVouchers  )  [protected]

Checks if cumulation with vouchers from the other series possible. Returns true on success.

Parameters:
array $aVouchers array of vouchers
Exceptions:
oxVoucherException exception
Returns:
bool

oxVoucher._isValidDate (  )  [protected]

Checks if voucher is in valid time period. Returns true on success.

Exceptions:
oxVoucherException exception
Returns:
bool

oxVoucher._isNotReserved (  )  [protected]

Checks if voucher is not yet reserved before.

Exceptions:
oxVoucherException exception
Returns:
bool

oxVoucher.checkUserAvailability ( oUser  ) 

Checks availability for the given user. Returns array with errors.

Parameters:
object $oUser user object
Exceptions:
oxVoucherException exception
Returns:
array

oxVoucher._isAvailableInOtherOrder ( oUser  )  [protected]

Checks if user already used vouchers from this series and can he use it again.

Parameters:
object $oUser user object
Exceptions:
oxVoucherException exception
Returns:
boolean

oxVoucher._isValidUserGroup ( oUser  )  [protected]

Checks if user belongs to the same group as the voucher. Returns true on sucess.

Parameters:
object $oUser user object
Exceptions:
oxVoucherException exception
Returns:
bool

oxVoucher.getSimpleVoucher (  ) 

Returns compact voucher object which is used in oxbasket

Returns:
oxstdclass

oxVoucher.getSerie (  ) 

create oxVoucherSerie object of this voucher

Returns:
oxVoucherSerie


Member Data Documentation

oxVoucher.$_oSerie = null [private]

oxVoucher.$_blDisableShopCheck = true [protected]

oxVoucher.$_sClassName = 'oxvoucher' [protected]

Reimplemented from oxBase.


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

Generated on Wed Oct 29 23:46:49 2008 for OXID eShop CE by  doxygen 1.5.5