eZ Publish  [4.2]
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 ()
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 39 of file ezproductcollectionitem.php.


Member Function Documentation

eZProductCollectionItem::__clone ( )

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

Definition at line 115 of file ezproductcollectionitem.php.

eZProductCollectionItem::calculatePriceWithOptions ( currency = false)

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

Referenced by eZDBGarbageCollector\collectProductCollections().

eZProductCollectionItem::contentObject ( )
Returns:
Returns the content object defining the product.

Definition at line 175 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 128 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 107 of file ezproductcollectionitem.php.

static eZProductCollectionItem::definition ( ) [static]
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:

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" );
}

Reimplemented from eZPersistentObject.

Definition at line 46 of file ezproductcollectionitem.php.

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

eZProductCollectionItem::discountPercent ( )
Returns:
the discount percent for the current item

Definition at line 166 of file ezproductcollectionitem.php.

eZProductCollectionItem::eZProductCollectionItem ( row)

Definition at line 41 of file ezproductcollectionitem.php.

Referenced by create().

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

Definition at line 188 of file ezproductcollectionitem.php.

Referenced by copy().

eZProductCollectionItem::removeThis ( )
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 197 of file ezproductcollectionitem.php.

eZProductCollectionItem::verify ( currency = false)

Definition at line 253 of file ezproductcollectionitem.php.


Member Data Documentation

eZProductCollectionItem::$ContentObject = null

Stores the content object.

Definition at line 322 of file ezproductcollectionitem.php.


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