Public Member Functions | Protected Member Functions | Protected Attributes

oxUserBasket Class Reference

Inheritance diagram for oxUserBasket:
Collaboration diagram for oxUserBasket:

List of all members.

Public Member Functions

 __construct ()
 setIsNewBasket ()
 isNewBasket ()
 isEmpty ()
 getArticles ()
 getItems ($blReload=false, $blActiveCheck=true)
 getItem ($sProductId, $aSelList, $aPersParams=null)
 getItemCount ($blReload=false)
 addItemToBasket ($sProductId=null, $dAmount=null, $aSel=null, $blOverride=false, $aPersParam=null)
 delete ($sOXID=null)
 isVisible ()

Protected Member Functions

 _insert ()
 _createItem ($sProductId, $aSelList=null, $aPersParams=null)
 _getItemKey ($sProductId, $aSel=null, $aPersParam=null)

Protected Attributes

 $_aSkipSaveFields = array('oxcreate')
 $_sClassName = 'oxUserbasket'
 $_aBasketItems = null
 $_blNewBasket = false

Detailed Description

Virtual basket manager class. Virtual baskets are user article lists which are stored in database (noticelists, wishlists). The name of the class is left like this because of historic reasons. It is more relevant to wishlist and noticelist than to shoping basket. Collects shopping basket information, updates it (DB level), removes or adds articles to it.

Definition at line 10 of file oxuserbasket.php.


Constructor & Destructor Documentation

oxUserBasket.__construct (  ) 

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

Returns:
null

Reimplemented from oxBase.

Definition at line 46 of file oxuserbasket.php.


Member Function Documentation

oxUserBasket._createItem ( sProductId,
aSelList = null,
aPersParams = null 
) [protected]

Creates and returns oxuserbasketitem object

Parameters:
string $sProductId Product Id
array $aSelList product select lists
string $aPersParams persistent parameters
Returns:
oxUserBasketItem

Definition at line 181 of file oxuserbasket.php.

oxUserBasket._getItemKey ( sProductId,
aSel = null,
aPersParam = null 
) [protected]

Returns unique item key according to its ID and user chosen select

Parameters:
string $sProductId Product Id
array $aSel product select lists
array $aPersParam basket item persistent parameters
Returns:
string

Definition at line 242 of file oxuserbasket.php.

oxUserBasket._insert (  )  [protected]

Inserts object data to DB, returns true on success.

Returns:
mixed

Reimplemented from oxBase.

Definition at line 57 of file oxuserbasket.php.

oxUserBasket.addItemToBasket ( sProductId = null,
dAmount = null,
aSel = null,
blOverride = false,
aPersParam = null 
)

Method adds/removes user chosen article to/from his noticelist or wishlist. Returns total amount of articles in list.

Parameters:
string $sProductId Article ID
double $dAmount Product amount
array $aSel product select lists
bool $blOverride if true overrides $dAmount, else sums previous with current it
array $aPersParam product persistent parameters (default null)
Returns:
integer

Definition at line 272 of file oxuserbasket.php.

oxUserBasket.delete ( sOXID = null  ) 

Deletes current basket history

Parameters:
string $sOXID Object ID(default null)
Returns:
bool

Reimplemented from oxBase.

Definition at line 313 of file oxuserbasket.php.

oxUserBasket.getArticles (  ) 

Returns an array of articles belonging to the Items in the basket

Returns:
array of oxArticle

Definition at line 116 of file oxuserbasket.php.

oxUserBasket.getItem ( sProductId,
aSelList,
aPersParams = null 
)

Searches for item in basket items array and returns it. If not item was found - new item is created.

Parameters:
string $sProductId product id, basket item id or basket item index
array $aSelList select lists
string $aPersParams persistent parameters
Returns:
oxUserBasketItem

Definition at line 215 of file oxuserbasket.php.

oxUserBasket.getItemCount ( blReload = false  ) 

Returns current basket item count

Parameters:
bool $blReload if TRUE forces to reload list
Returns:
int

Definition at line 255 of file oxuserbasket.php.

oxUserBasket.getItems ( blReload = false,
blActiveCheck = true 
)

Returns list of basket items

Parameters:
bool $blReload if TRUE forces to reload list
bool $blActiveCheck should articles be checked for active state?
Returns:
array of oxUserBasketItems

Definition at line 137 of file oxuserbasket.php.

oxUserBasket.isEmpty (  ) 

Checks if user basket is empty

Returns:
bool

Definition at line 102 of file oxuserbasket.php.

oxUserBasket.isNewBasket (  ) 

Checks if user basket is newly created

Returns:
bool

Definition at line 92 of file oxuserbasket.php.

oxUserBasket.isVisible (  ) 

Checks if user basket is visible for current user (public or own basket)

Returns:
bool

Definition at line 333 of file oxuserbasket.php.

oxUserBasket.setIsNewBasket (  ) 

Sets basket as newly created. This usually means that it is not yet stored in DB and will only be stored if some item is added

Returns:
null

Definition at line 79 of file oxuserbasket.php.


Member Data Documentation

oxUserBasket.$_aBasketItems = null [protected]

Definition at line 32 of file oxuserbasket.php.

oxUserBasket.$_aSkipSaveFields = array('oxcreate') [protected]

Reimplemented from oxBase.

Definition at line 18 of file oxuserbasket.php.

oxUserBasket.$_blNewBasket = false [protected]

Definition at line 39 of file oxuserbasket.php.

oxUserBasket.$_sClassName = 'oxUserbasket' [protected]

Reimplemented from oxBase.

Definition at line 25 of file oxuserbasket.php.


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