eZ Publish  [trunk]
eZProductCollectionItem Class Reference

eZProductCollectionItem handles one product item More...

+ Inheritance diagram for eZProductCollectionItem:
+ Collaboration diagram for eZProductCollectionItem:

List of all members.

Public Member Functions

 __clone ()
 calculatePriceWithOptions ($currency=false)
 contentObject ()
 copy ($collectionID)
 discountPercent ()
 eZProductCollectionItem ($row)
 optionList ()
 removeThis ()
 verify ($currency=false)

Static Public Member Functions

static cleanupList ($productCollectionIDList)
 Removes all product collection items which related to the product collections specified in the parameter array.
static create ($productCollectionID)
static definition ()
 Returns the definition for the object, the default implementation is to return an empty array.
static fetch ($id, $asObject=true)
static fetchList ($conditions=null, $asObjects=true, $offset=false, $limit=false)

Public Attributes

 $ContentObject = null
 Stores the content object.

Detailed Description

eZProductCollectionItem handles one product item

Definition at line 19 of file ezproductcollectionitem.php.


Member Function Documentation

Clones the collection item object and returns it. The ID of the clone is erased.

Definition at line 95 of file ezproductcollectionitem.php.

Goes trough all options and finds the attribute they points to and calls productOptionInformation() to fetch the option data.

Returns:
The total price of all options.

Definition at line 196 of file ezproductcollectionitem.php.

Referenced by verify().

static eZProductCollectionItem::cleanupList ( productCollectionIDList) [static]

Removes all product collection items which related to the product collections specified in the parameter array.

Parameters:
array$productCollectionIDListarray of eZProductCollection IDs
Returns:
void

Definition at line 282 of file ezproductcollectionitem.php.

Referenced by eZDBGarbageCollector\collectProductCollections().

Returns:
Returns the content object defining the product.

Definition at line 155 of file ezproductcollectionitem.php.

Referenced by calculatePriceWithOptions().

eZProductCollectionItem::copy ( collectionID)

Copies the collection object item and the option, the new copy will point to the collection $collectionID.

Returns:
the new collection item object.
Note:
The new collection item will already be present in the database.
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 108 of file ezproductcollectionitem.php.

static eZProductCollectionItem::create ( productCollectionID) [static]

Creates a new empty collection item which belongs to collection $collectionID and returns it.

Definition at line 87 of file ezproductcollectionitem.php.

Referenced by eZShopOperationCollection\addToBasket().

Returns the definition for the object, the default implementation is to return an empty array.

It's upto each inheriting class to return a proper definition array.

The definition array is an associative array consists of these keys:

  • fields: an associative array of fields which defines which database field (the key) is to fetched and how they map to object member variables (the value).
  • keys: an array of fields which is used for uniquely identifying the object in the table.
  • function_attributes: an associative array of attributes which maps to member functions, used for fetching data with functions.
  • set_functions: an associative array of attributes which maps to member functions, used for setting data with functions.
  • increment_key: the field which is incremented on table inserts.
  • class_name: the classname which is used for instantiating new objecs when fetching from the database.
  • sort: an associative array which defines the default sorting of lists, the key is the table field while the value is the sorting method which is either 'asc' or 'desc'.
  • name: the name of the database table

Example: public static function definition() { return array( "fields" => array( "id" => "ID", "version" => "Version", "name" => "Name" ), "keys" => array( "id", "version" ), "function_attributes" => array( "current" => "currentVersion", "class_name" => "className" ), "increment_key" => "id", "class_name" => "eZContentClass", "sort" => array( "id" => "asc" ), "name" => "ezcontentclass" ); }

Returns:
array

Reimplemented from eZPersistentObject.

Definition at line 26 of file ezproductcollectionitem.php.

Referenced by fetch(), fetchList(), eZWishList\itemCount(), eZProductCollection\itemList(), eZBasket\items(), eZWishList\items(), eZOrder\productItems(), eZContentObject\purge(), and eZProductCollection\verify().

Returns:
the discount percent for the current item

Definition at line 146 of file ezproductcollectionitem.php.

Definition at line 21 of file ezproductcollectionitem.php.

Referenced by create().

static eZProductCollectionItem::fetchList ( conditions = null,
asObjects = true,
offset = false,
limit = false 
) [static]

Definition at line 168 of file ezproductcollectionitem.php.

Referenced by copy().

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 177 of file ezproductcollectionitem.php.

Definition at line 233 of file ezproductcollectionitem.php.


Member Data Documentation

eZProductCollectionItem::$ContentObject = null

Stores the content object.

Definition at line 302 of file ezproductcollectionitem.php.


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