eZ Publish  [4.2]
eZBasket Class Reference

eZBasket handles shopping baskets More...

+ Inheritance diagram for eZBasket:
+ Collaboration diagram for eZBasket:

List of all members.

Public Member Functions

 canAddProduct ($contentObject)
 createOrder ()
 eZBasket ($row)
 isEmpty ()
 isVATKnown ()
 items ($asObject=true)
 itemsInfo ()
 productCollection ()
 removeItem ($itemID)
 totalExVAT ()
 totalIncVAT ()
 type ()
 updatePrices ()

Static Public Member Functions

static cleanup ()
static cleanupCurrentBasket ($useSetting=true)
static cleanupExpired ($time)
static currentBasket ($asObject=true, $byOrderID=-1)
static definition ()
static fetch ($sessionKey)

Public Attributes

const ITEM_LIMIT = 3000

Detailed Description

eZBasket handles shopping baskets

See also:
eZProductCollection

Definition at line 39 of file ezbasket.php.


Member Function Documentation

eZBasket::canAddProduct ( contentObject)

Definition at line 559 of file ezbasket.php.

static eZBasket::cleanup ( ) [static]

Removes all baskets for all users.

Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 506 of file ezbasket.php.

static eZBasket::cleanupCurrentBasket ( useSetting = true) [static]

Removes current basket.

Parameters:
$useSetting- if "true" use ini setting in site.ini [ShopSettings].ClearBasketOnLogout, or just clear current basket otherwise.
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 598 of file ezbasket.php.

Referenced by eZUser\logoutCurrent().

static eZBasket::cleanupExpired ( time) [static]

Removes all baskets which are considered expired (due to session expiration).

Note:
This will also remove the product collection the basket is using.

Definition at line 448 of file ezbasket.php.

eZBasket::createOrder ( )

Creates a temporary order for the current basket. The order object is returned.

Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 350 of file ezbasket.php.

static eZBasket::currentBasket ( asObject = true,
byOrderID = -1 
) [static]

Will return the basket for the current session. If a basket does not exist one will be created.

Returns:
current eZBasket object
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 302 of file ezbasket.php.

Referenced by cleanupCurrentBasket().

static eZBasket::definition ( ) [static]
Returns:
the persistent object definition for the eZCard class.

Reimplemented from eZPersistentObject.

Definition at line 54 of file ezbasket.php.

Referenced by currentBasket(), and fetch().

eZBasket::eZBasket ( row)

Definition at line 46 of file ezbasket.php.

Referenced by currentBasket().

static eZBasket::fetch ( sessionKey) [static]

Fetches the basket which belongs to session $sessionKey.

Parameters:
$sessionKeyA string containing the session key.
Returns:
An eZSessionBasket object or false if none was found.

Definition at line 289 of file ezbasket.php.

Referenced by productCollection(), and removeItem().

eZBasket::isEmpty ( )

Definition at line 278 of file ezbasket.php.

eZBasket::isVATKnown ( )

Returns true if VAT percentage is known for all basket items.

Definition at line 229 of file ezbasket.php.

eZBasket::items ( asObject = true)

Definition at line 91 of file ezbasket.php.

Referenced by isEmpty(), isVATKnown(), itemsInfo(), totalExVAT(), totalIncVAT(), and updatePrices().

eZBasket::itemsInfo ( )

Fetching calculated information about the product items.

Definition at line 158 of file ezbasket.php.

eZBasket::productCollection ( )

Definition at line 584 of file ezbasket.php.

eZBasket::removeItem ( itemID)
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 269 of file ezbasket.php.

eZBasket::totalExVAT ( )

Definition at line 253 of file ezbasket.php.

eZBasket::totalIncVAT ( )

Definition at line 241 of file ezbasket.php.

eZBasket::type ( )
Returns:
the type of basket. In other words: what type of products the basket contains.

Definition at line 537 of file ezbasket.php.

Referenced by canAddProduct().

eZBasket::updatePrices ( )
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 384 of file ezbasket.php.


Member Data Documentation

const eZBasket::ITEM_LIMIT = 3000

Controls the default value for how many items are cleaned in one batch operation.

Definition at line 44 of file ezbasket.php.

Referenced by cleanup(), and cleanupExpired().


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