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

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 ()
- Public Member Functions inherited from oxBase
 getUseSkipSaveFields ()
 setUseSkipSaveFields ($blUseSkipSaveFields)
 __set ($sName, $sValue)
 __get ($sName)
 __isset ($mVar)
 __clone ()
 oxClone ($oObject)
 getUpdateSeo ()
 setUpdateSeo ($blUpdateSeo)
 init ($sTableName=null, $blForceAllFields=false)
 assign ($dbRecord)
 getClassName ()
 getCoreTableName ()
 getId ()
 setId ($sOXID=null)
 setShopId ($iShopId)
 getShopId ()
 getViewName ($blForceCoreTableUsage=null)
 modifyCacheKey ($sCacheKey, $blOverride=false)
 disableLazyLoading ()
 isDerived ()
 setIsDerived ($blVal)
 isMultilang ()
 load ($sOXID)
 isLoaded ()
 buildSelectString ($aWhere=null)
 assignRecord ($sSelect)
 getFieldData ($sFieldName)
 getSelectFields ($blForceCoreTableUsage=null)
 save ()
 allowDerivedUpdate ()
 allowDerivedDelete ()
 exists ($sOXID=null)
 getSqlActiveSnippet ($blForceCoreTable=null)
 beforeUpdate ($sOXID=null)
 onChange ($iAction=null, $sOXID=null)
 setInList ()
 isOx ()
 isReadOnly ()
 setReadOnly ($blReadOnly)
 getFieldNames ()
 addFieldName ($sName)
 getLanguage ()
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _insert ()
 _createItem ($sProductId, $aSelList=null, $aPersParams=null)
 _getItemKey ($sProductId, $aSel=null, $aPersParam=null)
- Protected Member Functions inherited from oxBase
 _setUpdateSeoOnFieldChange ($sField)
 _removeElement2ShopRelations ($sOxId)
 _isInList ()
 _getObjectViewName ($sTable, $sShopID=null)
 _getTableFields ($sTable, $blReturnSimple=false)
 _getAllFields ($blReturnSimple=false)
 _initDataStructure ($blForceFullStructure=false)
 _getNonCachedFieldNames ($blForceFullStructure=false)
 _getFieldStatus ($sFieldName)
 _addField ($sName, $iStatus, $sType=null, $sLength=null)
 _getFieldLongName ($sFieldName)
 _setFieldData ($sFieldName, $sValue, $iDataType=oxField::T_TEXT)
 _canFieldBeNull ($sFieldName)
 _getFieldDefaultValue ($sFieldName)
 _getUpdateFieldValue ($sFieldName, $oField)
 _getUpdateFields ($blUseSkipSaveFields=true)
 _update ()
 _isDisabledFieldCache ()
 _addSkippedSaveFieldsForMapping ()
 _disableLazyLoadingForCaching ()

Protected Attributes

 $_aSkipSaveFields = array('oxcreate', 'oxtimestamp')
 $_sClassName = 'oxUserbasket'
 $_aBasketItems = null
 $_blNewBasket = false
- Protected Attributes inherited from oxBase
 $_sOXID = null
 $_iShopId = null
 $_blIsSimplyClonable = true
 $_sClassName = 'oxbase'
 $_sCoreTable = null
 $_sViewTable = null
 $_aFieldNames = array('oxid' => 0)
 $_sCacheKey = null
 $_blUseLazyLoading = false
 $_aSkipSaveFields = array('oxtimestamp')
 $_blUseSkipSaveFields = true
 $_sExistKey = 'oxid'
 $_blIsDerived = null
 $_blIsSeoObject = false
 $_blUpdateSeo = true
 $_blReadOnly = false
 $_blIsInList = false
 $_isLoaded = false
 $_aInnerLazyCache = null
 $_blEmployMultilanguage = false

Additional Inherited Members

- Static Protected Attributes inherited from oxBase
static $_blDisableFieldCaching = array()

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 11 of file oxuserbasket.php.

Constructor & Destructor Documentation

oxUserBasket::__construct ( )

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

Returns
null

Reimplemented from oxBase.

Definition at line 47 of file oxuserbasket.php.

Member Function Documentation

oxUserBasket::_createItem (   $sProductId,
  $aSelList = null,
  $aPersParams = null 
)
protected

Creates and returns oxuserbasketitem object

Parameters
string$sProductIdProduct Id
array$aSelListproduct select lists
string$aPersParamspersistent parameters
Returns
oxUserBasketItem

Definition at line 179 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$sProductIdProduct Id
array$aSelproduct select lists
array$aPersParambasket item persistent parameters
Returns
string

Definition at line 240 of file oxuserbasket.php.

oxUserBasket::_insert ( )
protected

Inserts object data to DB, returns true on success.

Returns
mixed

Reimplemented from oxBase.

Definition at line 58 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$sProductIdArticle ID
double$dAmountProduct amount
array$aSelproduct select lists
bool$blOverrideif true overrides $dAmount, else sums previous with current it
array$aPersParamproduct persistent parameters (default null)
Returns
integer

Definition at line 271 of file oxuserbasket.php.

oxUserBasket::delete (   $sOXID = null)

Deletes current basket history

Parameters
string$sOXIDObject ID(default null)
Returns
bool

Reimplemented from oxBase.

Definition at line 312 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 113 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$sProductIdproduct id, basket item id or basket item index
array$aSelListselect lists
string$aPersParamspersistent parameters
Returns
oxUserBasketItem

Definition at line 213 of file oxuserbasket.php.

oxUserBasket::getItemCount (   $blReload = false)

Returns current basket item count

Parameters
bool$blReloadif TRUE forces to reload list
Returns
int

Definition at line 254 of file oxuserbasket.php.

oxUserBasket::getItems (   $blReload = false,
  $blActiveCheck = true 
)

Returns list of basket items

Parameters
bool$blReloadif TRUE forces to reload list
bool$blActiveCheckshould articles be checked for active state?
Returns
array of oxUserBasketItems

Definition at line 135 of file oxuserbasket.php.

oxUserBasket::isEmpty ( )

Checks if user basket is empty

Returns
bool

Definition at line 99 of file oxuserbasket.php.

oxUserBasket::isNewBasket ( )

Checks if user basket is newly created

Returns
bool

Definition at line 89 of file oxuserbasket.php.

oxUserBasket::isVisible ( )

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

Returns
bool

Definition at line 335 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

Definition at line 77 of file oxuserbasket.php.

Member Data Documentation

oxUserBasket::$_aBasketItems = null
protected

Definition at line 33 of file oxuserbasket.php.

oxUserBasket::$_aSkipSaveFields = array('oxcreate', 'oxtimestamp')
protected

Definition at line 19 of file oxuserbasket.php.

oxUserBasket::$_blNewBasket = false
protected

Definition at line 40 of file oxuserbasket.php.

oxUserBasket::$_sClassName = 'oxUserbasket'
protected

Definition at line 26 of file oxuserbasket.php.


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