OXID eShop CE  4.10.4
 All Classes Namespaces Files Functions Variables Pages
oxBasketReservation Class Reference
+ Inheritance diagram for oxBasketReservation:
+ Collaboration diagram for oxBasketReservation:

Public Member Functions

 getReservations ()
 getReservedAmount ($sArticleId)
 reserveBasket (oxBasket $oBasket)
 commitArticleReservation ($sArticleId, $dAmount)
 discardArticleReservation ($sArticleId)
 discardReservations ()
 discardUnusedReservations ($iLimit)
 getTimeLeft ()
 renewExpiration ()
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 __construct ()
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _getReservationsId ()
 _loadReservations ($sBasketId)
 _getReservedItems ()
 _basketDifference (oxBasket $oBasket)
 _reserveArticles ($aBasketDiff)

Protected Attributes

 $_oReservations = null
 $_aCurrentlyReserved = null

Additional Inherited Members

- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Basket reservations handler class

Definition at line 7 of file oxbasketreservation.php.

Member Function Documentation

oxBasketReservation::_basketDifference ( oxBasket  $oBasket)
protected

compute difference of reserved amounts vs basket items

Parameters
oxBasket$oBasketbasket object
Returns
array

Definition at line 134 of file oxbasketreservation.php.

oxBasketReservation::_getReservationsId ( )
protected

return the ID of active resevations user basket

Returns
string

Definition at line 29 of file oxbasketreservation.php.

oxBasketReservation::_getReservedItems ( )
protected

return currently reserved items in an array format array (artId => amount)

Returns
array

Definition at line 88 of file oxbasketreservation.php.

oxBasketReservation::_loadReservations (   $sBasketId)
protected

load reservation or create new reservation oxuserbasket

Parameters
string$sBasketIdbasket id for this userbasket
Returns
oxuserbasket

Definition at line 47 of file oxbasketreservation.php.

oxBasketReservation::_reserveArticles (   $aBasketDiff)
protected

reserve articles given the basket difference array

Parameters
array$aBasketDiffbasket difference array
See Also
oxBasketReservation::_basketDifference

Definition at line 157 of file oxbasketreservation.php.

oxBasketReservation::commitArticleReservation (   $sArticleId,
  $dAmount 
)

commit reservation of given article amount deletes this amount from active reservations userBasket, update sold amount

Parameters
string$sArticleIdarticle id
double$dAmountamount to use

Definition at line 194 of file oxbasketreservation.php.

oxBasketReservation::discardArticleReservation (   $sArticleId)

discard one article reservation return the reserved stock to article

Parameters
string$sArticleIdarticle id

Definition at line 217 of file oxbasketreservation.php.

oxBasketReservation::discardReservations ( )

discard all reserved articles

Definition at line 233 of file oxbasketreservation.php.

oxBasketReservation::discardUnusedReservations (   $iLimit)

periodic cleanup: discards timed out reservations even if they are not for the current user

Parameters
int$iLimitlimit for discarding (performance related)
Returns
null

Definition at line 253 of file oxbasketreservation.php.

oxBasketReservation::getReservations ( )

get reservations collection

Returns
oxUserBasket

Definition at line 68 of file oxbasketreservation.php.

oxBasketReservation::getReservedAmount (   $sArticleId)

return currently reserved amount for an article

Parameters
string$sArticleIdarticle id
Returns
double

Definition at line 117 of file oxbasketreservation.php.

oxBasketReservation::getTimeLeft ( )

return time left (in seconds) for basket before expiration

Returns
int

Definition at line 288 of file oxbasketreservation.php.

oxBasketReservation::renewExpiration ( )

renews expiration timer to maximum value

Definition at line 309 of file oxbasketreservation.php.

oxBasketReservation::reserveBasket ( oxBasket  $oBasket)

reserve given basket items, only when not in admin mode

Parameters
oxBasket$oBasketbasket object

Definition at line 179 of file oxbasketreservation.php.

Member Data Documentation

oxBasketReservation::$_aCurrentlyReserved = null
protected

Definition at line 22 of file oxbasketreservation.php.

oxBasketReservation::$_oReservations = null
protected

Definition at line 15 of file oxbasketreservation.php.


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