Public Member Functions | Protected Member Functions | Protected Attributes

oxBasketReservation Class Reference

Inheritance diagram for oxBasketReservation:
Collaboration diagram for oxBasketReservation:

List of all members.

Public Member Functions

 getReservations ()
 getReservedAmount ($sArticleId)
 reserveBasket (oxBasket $oBasket)
 commitArticleReservation ($sArticleId, $dAmount)
 discardArticleReservation ($sArticleId)
 discardReservations ()
 discardUnusedReservations ($iLimit)
 getTimeLeft ()
 renewExpiration ()

Protected Member Functions

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

Protected Attributes

 $_oReservations = null
 $_aCurrentlyReserved = 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 $oBasket basket object
Returns:
array

Definition at line 129 of file oxbasketreservation.php.

oxBasketReservation._getReservationsId (  )  [protected]

return the ID of active resevations user basket

Returns:
string

Definition at line 28 of file oxbasketreservation.php.

oxBasketReservation._getReservedItems (  )  [protected]

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

Returns:
array

Definition at line 85 of file oxbasketreservation.php.

oxBasketReservation._loadReservations ( sBasketId  )  [protected]

load reservation or create new reservation oxuserbasket

Parameters:
string $sBasketId basket id for this userbasket
Returns:
oxuserbasket

Definition at line 45 of file oxbasketreservation.php.

oxBasketReservation._reserveArticles ( aBasketDiff  )  [protected]

reserve articles given the basket difference array

Parameters:
array $aBasketDiff basket difference array
See also:
oxBasketReservation._basketDifference
Returns:
null

Definition at line 153 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 $sArticleId article id
double $dAmount amount to use
Returns:
null

Definition at line 192 of file oxbasketreservation.php.

oxBasketReservation.discardArticleReservation ( sArticleId  ) 

discard one article reservation return the reserved stock to article

Parameters:
string $sArticleId article id
Returns:
null

Definition at line 217 of file oxbasketreservation.php.

oxBasketReservation.discardReservations (  ) 

discard all reserved articles

Returns:
null

Definition at line 235 of file oxbasketreservation.php.

oxBasketReservation.discardUnusedReservations ( iLimit  ) 

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

Parameters:
int $iLimit limit for discarding (performance related)
Returns:
null

Definition at line 255 of file oxbasketreservation.php.

oxBasketReservation.getReservations (  ) 

get reservations collection

Returns:
oxUserBasket

Definition at line 65 of file oxbasketreservation.php.

oxBasketReservation.getReservedAmount ( sArticleId  ) 

return currently reserved amount for an article

Parameters:
string $sArticleId article id
Returns:
double

Definition at line 113 of file oxbasketreservation.php.

oxBasketReservation.getTimeLeft (  ) 

return time left (in seconds) for basket before expiration

Returns:
int

Definition at line 290 of file oxbasketreservation.php.

oxBasketReservation.renewExpiration (  ) 

renews expiration timer to maximum value

Returns:
null

Definition at line 312 of file oxbasketreservation.php.

oxBasketReservation.reserveBasket ( oxBasket oBasket  ) 

reserve given basket items

Parameters:
oxBasket $oBasket basket object
Returns:
null

Definition at line 177 of file oxbasketreservation.php.


Member Data Documentation

oxBasketReservation.$_aCurrentlyReserved = null [protected]

Definition at line 21 of file oxbasketreservation.php.

oxBasketReservation.$_oReservations = null [protected]

Definition at line 14 of file oxbasketreservation.php.


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