Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezproductcollectionitemoption.php
Go to the documentation of this file.
1 <?php
11 class eZProductCollectionItemOption extends eZPersistentObject
12 {
13 static function definition()
14 {
15 return array( "fields" => array( "id" => array( 'name' => 'ID',
16 'datatype' => 'integer',
17 'default' => 0,
18 'required' => true ),
19 'item_id' => array( 'name' => 'ItemID',
20 'datatype' => 'integer',
21 'default' => 0,
22 'required' => true,
23 'foreign_class' => 'eZProductCollectionItem',
24 'foreign_attribute' => 'id',
25 'multiplicity' => '1..*' ),
26 'option_item_id' => array( 'name' => 'OptionItemID',
27 'datatype' => 'integer',
28 'default' => 0,
29 'required' => true,
30 'foreign_class' => 'eZProductCollectionItemOption',
31 'foreign_attribute' => 'id',
32 'multiplicity' => '1..*' ),
33 'object_attribute_id' => array( 'name' => 'ObjectAttributeID',
34 'datatype' => 'integer',
35 'default' => 0,
36 'required' => true,
37 'foreign_class' => 'eZContentObjectAttribute',
38 'foreign_attribute' => 'id',
39 'multiplicity' => '1..*' ),
40 'name' => array( 'name' => 'Name',
41 'datatype' => 'string',
42 'default' => '',
43 'required' => true ),
44 'value' => array( 'name' => 'Value',
45 'datatype' => 'string',
46 'default' => '',
47 'required' => true ),
48 'price' => array( 'name' => 'Price',
49 'datatype' => 'float',
50 'default' => 0,
51 'required' => true ) ),
52 "keys" => array( "id" ),
53 "increment_key" => "id",
54 "class_name" => "eZProductCollectionItemOption",
55 "name" => "ezproductcollection_item_opt" );
56 }
57
68 static function create( $productCollectionItemID, $optionItemID, $optionName, $optionValue, $optionPrice, $attributeID )
69 {
70 $row = array( 'item_id' => $productCollectionItemID,
71 'option_item_id' => $optionItemID,
72 'name' => $optionName,
73 'value' => $optionValue,
74 'price' => $optionPrice,
75 'object_attribute_id' => $attributeID );
76 return new eZProductCollectionItemOption( $row );
77 }
78
83 function __clone()
84 {
85 $this->setAttribute( 'id', null );
86 }
87
96 function copy( $collectionItemID )
97 {
98 $item = clone $this;
99 $item->setAttribute( 'item_id', $collectionItemID );
100 $item->store();
101 return $item;
102 }
103
113 static function fetchList( $productCollectionItemID, $asObject = true )
114 {
115 return eZPersistentObject::fetchObjectList( eZProductCollectionItemOption::definition(),
116 null, array( "item_id" => $productCollectionItemID ),
117 array( "id" => "ASC" ),
118 null,
119 $asObject );
120 }
121
130 static function cleanupList( $itemIDList )
131 {
132 $db = eZDB::instance();
133 $inText = $db->generateSQLINStatement( $itemIDList, 'item_id', false, false, 'int' );
134 $db->query( $q = "DELETE FROM ezproductcollection_item_opt WHERE $inText" );
135 }
136
137 }
138
139 ?>
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\setAttribute
setAttribute( $attr, $val)
Definition: ezpersistentobject.php:1374
eZPersistentObject\fetchObjectList
static fetchObjectList( $def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
Definition: ezpersistentobject.php:806
eZProductCollectionItemOption
Definition: ezproductcollectionitemoption.php:12
eZProductCollectionItemOption\definition
static definition()
Definition: ezproductcollectionitemoption.php:13
eZProductCollectionItemOption\cleanupList
static cleanupList( $itemIDList)
Definition: ezproductcollectionitemoption.php:130
eZProductCollectionItemOption\copy
copy( $collectionItemID)
Definition: ezproductcollectionitemoption.php:96
eZProductCollectionItemOption\fetchList
static fetchList( $productCollectionItemID, $asObject=true)
Definition: ezproductcollectionitemoption.php:113
eZProductCollectionItemOption\__clone
__clone()
Definition: ezproductcollectionitemoption.php:83
eZProductCollectionItemOption\create
static create( $productCollectionItemID, $optionItemID, $optionName, $optionValue, $optionPrice, $attributeID)
Definition: ezproductcollectionitemoption.php:68
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.