eZ Publish  [trunk]
eZProductCollection Class Reference

eZProductCollection is a container class which handles groups of products More...

+ Inheritance diagram for eZProductCollection:
+ Collaboration diagram for eZProductCollection:

List of all members.

Public Member Functions

 __clone ()
 Clones the collection object and returns it.
 copy ()
 Copies the collection object, the collection items and options.
 eZProductCollection ($row)
 itemList ($asObject=true)
 Returns all production collection items as an array.

Static Public Member Functions

static cleanupList ($productCollectionIDList)
 Removes all product collections based on a product collection ID list Will also remove the product collection items.
static create ()
 Creates a new empty collection and returns it.
static definition ()
 Returns the definition for the object, the default implementation is to return an empty array.
static fetch ($productCollectionID, $asObject=true)
 Fetches an eZProductCollection based on its ID.
static verify ($id)

Detailed Description

eZProductCollection is a container class which handles groups of products

Definition at line 15 of file ezproductcollection.php.


Member Function Documentation

Clones the collection object and returns it.

The ID of the clone is erased.

Definition at line 57 of file ezproductcollection.php.

static eZProductCollection::cleanupList ( productCollectionIDList) [static]

Removes all product collections based on a product collection ID list Will also remove the product collection items.

Parameters:
array$productCollectionIDListarray of eZProductCollection IDs
Returns:
void

Definition at line 158 of file ezproductcollection.php.

Referenced by eZWishList\cleanup(), eZBasket\cleanup(), eZOrder\cleanup(), eZBasket\cleanupCurrentBasket(), eZBasket\cleanupExpired(), and eZDBGarbageCollector\collectBaskets().

Copies the collection object, the collection items and options.

Note:
The new collection will already be present in the database.
Returns:
eZProductCollection The new collection object.

Definition at line 69 of file ezproductcollection.php.

static eZProductCollection::create ( ) [static]

Creates a new empty collection and returns it.

Returns:
eZProductCollection

Definition at line 47 of file ezproductcollection.php.

Referenced by eZBasket\currentBasket(), eZWishList\currentWishList(), and eZShopFunctionCollection\fetchBasket().

static eZProductCollection::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: 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 22 of file ezproductcollection.php.

Referenced by fetch().

Definition at line 17 of file ezproductcollection.php.

Referenced by create().

static eZProductCollection::fetch ( productCollectionID,
asObject = true 
) [static]

Fetches an eZProductCollection based on its ID.

Parameters:
int$productCollectionID
bool$asObjectIf true, return an object. if false, returns an array
Returns:
array|eZProductCollection

Definition at line 95 of file ezproductcollection.php.

Referenced by verify().

Returns all production collection items as an array.

Parameters:
bool$asObjectIf true, return an object. if false, returns an array
Returns:
array(eZProductCollection|array)

Definition at line 111 of file ezproductcollection.php.

Referenced by copy().

static eZProductCollection::verify ( id) [static]

Definition at line 120 of file ezproductcollection.php.


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