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
00040 include_once( "kernel/classes/ezpersistentobject.php" );
00041
00042 class eZWaitUntilDateValue extends eZPersistentObject
00043 {
00044
00045
00046
00047 function eZWaitUntilDateValue( $row )
00048 {
00049 $this->eZPersistentObject( $row );
00050 $this->ClassName = null;
00051 $this->ClassAttributeName = null;
00052
00053 }
00054
00055 function definition()
00056 {
00057 return array( "fields" => array( "id" => array( 'name' => 'ID',
00058 'datatype' => 'integer',
00059 'default' => 0,
00060 'required' => true ),
00061 "workflow_event_id" => array( 'name' => "WorkflowEventID",
00062 'datatype' => 'integer',
00063 'default' => 0,
00064 'required' => true,
00065 'foreign_class' => 'eZWorkflowEvent',
00066 'foreign_attribute' => 'id',
00067 'multiplicity' => '1..*' ),
00068 "workflow_event_version" => array( 'name' => "WorkflowEventVersion",
00069 'datatype' => 'integer',
00070 'default' => 0,
00071 'required' => true ),
00072 "contentclass_id" => array( 'name' => "ContentClassID",
00073 'datatype' => 'integer',
00074 'default' => 0,
00075 'required' => true,
00076 'foreign_class' => 'eZContentClass',
00077 'foreign_attribute' => 'id',
00078 'multiplicity' => '1..*' ),
00079 "contentclass_attribute_id" => array( 'name' => "ContentClassAttributeID",
00080 'datatype' => 'integer',
00081 'default' => 0,
00082 'required' => true,
00083 'foreign_class' => 'eZContentClassAttribute',
00084 'foreign_attribute' => 'id',
00085 'multiplicity' => '1..*' ) ),
00086 "keys" => array( "id", "workflow_event_id", "workflow_event_version" ),
00087 "function_attributes" => array( "class_name" => "className",
00088 "classattribute_name" => "classAttributeName" ),
00089 "increment_key" => "id",
00090 "sort" => array( "id" => "asc" ),
00091 "class_name" => "eZWaitUntilDateValue",
00092 "name" => "ezwaituntildatevalue" );
00093 }
00094
00095 function &className()
00096 {
00097 if ( $this->ClassName === null )
00098 {
00099 $contentClass = eZContentClass::fetch( $this->attribute( 'contentclass_id' ) );
00100 $this->ClassName =& $contentClass->attribute( 'name' );
00101 }
00102 return $this->ClassName;
00103 }
00104
00105 function &classAttributeName()
00106 {
00107 if ( $this->ClassAttributeName === null )
00108 {
00109 $contentClassAttribute =& eZContentClassAttribute::fetch( $this->attribute( 'contentclass_attribute_id' ) );
00110 $this->ClassAttributeName =& $contentClassAttribute->attribute( 'name' );
00111 }
00112 return $this->ClassAttributeName;
00113 }
00114
00115 function &clone()
00116 {
00117 $row = array( "id" => null,
00118 "workflow_event_id" => $this->attribute( 'workflow_event_id' ),
00119 "workflow_event_version" => $this->attribute( 'workflow_event_version' ),
00120 "contentclass_id" => $this->attribute( "contentclass_id" ),
00121 "contentclass_attribute_id" => $this->attribute( 'contentclass_attribute_id' ) );
00122 $newWaitUntilDateValue = new eZWaitUntilDateValue( $row );
00123 return $newWaitUntilDateValue;
00124 }
00125
00126 function create( $workflowEventID, $workflowEventVersion, $contentClassAttributeID, $contentClassID )
00127 {
00128 $row = array( "id" => null,
00129 "workflow_event_id" => $workflowEventID,
00130 "workflow_event_version" => $workflowEventVersion,
00131 "contentclass_id" => $contentClassID,
00132 "contentclass_attribute_id" => $contentClassAttributeID
00133 );
00134 return new eZWaitUntilDateValue( $row );
00135 }
00136
00137 function createCopy( $id, $workflowEventID, $workflowEventVersion, $contentClassID , $contentClassAttributeID )
00138 {
00139 $row = array( "id" => $id,
00140 "workflow_event_id" => $workflowEventID,
00141 "workflow_event_version" => $workflowEventVersion,
00142 "contentclass_id" => $contentClassID,
00143 "contentclass_attribute_id" => $contentClassAttributeID );
00144 return new eZWaitUntilDateValue( $row );
00145 }
00146
00147
00148 function removeAllElements( $workflowEventID, $version )
00149 {
00150 eZPersistentObject::removeObject( eZWaitUntilDateValue::definition(),
00151 array( "workflow_event_id" => $workflowEventID,
00152 "workflow_event_version" => $version) );
00153 }
00154
00155 function remove( $id , $version )
00156 {
00157 eZPersistentObject::removeObject( eZWaitUntilDateValue::definition(),
00158 array( "id" => $id,
00159 "workflow_event_version" => $version) );
00160 }
00161
00162 function &fetch( $id, $version, $asObject = true )
00163 {
00164 $object = eZPersistentObject::fetchObject( eZWaitUntilDateValue::definition(),
00165 null,
00166 array( "id" => $id,
00167 "workflow_event_version" => $version),
00168 $asObject );
00169 return $object;
00170 }
00171
00172 function &fetchAllElements( $workflowEventID, $version, $asObject = true )
00173 {
00174 $objectList = eZPersistentObject::fetchObjectList( eZWaitUntilDateValue::definition(),
00175 null,
00176 array( "workflow_event_id" => $workflowEventID,
00177 "workflow_event_version" => $version ),
00178 null,
00179 null,
00180 $asObject );
00181 return $objectList;
00182 }
00183
00184 var $ClassName;
00185 var $ClassAttributeName;
00186 }
00187
00188 ?>