00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 include_once( "kernel/classes/ezpersistentobject.php" );
00040 class eZDiscountSubRuleValue extends eZPersistentObject
00041 {
00042
00043
00044
00045 function eZDiscountSubRuleValue( $row )
00046 {
00047 $this->eZPersistentObject( $row );
00048 }
00049
00050 function definition()
00051 {
00052 return array( "fields" => array( "discountsubrule_id" => array( 'name' => "DiscountSubRuleID",
00053 'datatype' => 'integer',
00054 'default' => 0,
00055 'required' => true,
00056 'foreign_class' => 'eZDiscountSubRule',
00057 'foreign_attribute' => 'id',
00058 'multiplicity' => '1..*' ),
00059 "value" => array( 'name' => "Value",
00060 'datatype' => 'integer',
00061 'default' => 0,
00062 'required' => true ),
00063 "issection" => array( 'name' => "IsSection",
00064 'datatype' => 'integer',
00065 'default' => 0,
00066 'required' => true ) ),
00067 "keys" => array( "discountsubrule_id", "value", "issection" ),
00068 "increment_key" => "discountsubrule_id",
00069 "class_name" => "eZDiscountSubRuleValue",
00070 "name" => "ezdiscountsubrule_value" );
00071 }
00072
00073 function fetchBySubRuleID( $discountSubRuleID, $isSection = 0, $asObject = true )
00074 {
00075 return eZPersistentObject::fetchObjectList( eZDiscountSubRuleValue::definition(),
00076 null,
00077 array( "discountsubrule_id" => $discountSubRuleID,
00078 "issection" => $isSection ),
00079 null,
00080 null,
00081 $asObject );
00082 }
00083
00084
00085
00086
00087
00088 function remove( $discountSubRuleID, $value, $isSection )
00089 {
00090 eZPersistentObject::removeObject( eZDiscountSubRuleValue::definition(),
00091 array( "discountsubrule_id" =>$discountSubRuleID,
00092 "value" => $value,
00093 "issection" => $isSection ) );
00094 }
00095
00096 function &fetchList( $asObject = true )
00097 {
00098 $objectList = eZPersistentObject::fetchObjectList( eZDiscountSubRuleValue::definition(),
00099 null, null, null, null,
00100 $asObject );
00101 return $objectList;
00102 }
00103
00104 function create( $discountSubRuleID, $value, $isSection = false )
00105 {
00106 $row = array(
00107 "discountsubrule_id" => $discountSubRuleID,
00108 "value" => $value,
00109 "issection" => $isSection );
00110 return new eZDiscountSubRuleValue( $row );
00111 }
00112
00113
00114
00115
00116
00117 function removeBySubRuleID ( $discountSubRuleID )
00118 {
00119 eZPersistentObject::removeObject( eZDiscountSubRuleValue::definition(),
00120 array( "discountsubrule_id" => $discountSubRuleID ) );
00121 }
00122 }
00123 ?>