eZ Publish  [4.0]
ezwaituntildatevalue.php
Go to the documentation of this file.
00001 <?php
00002 //
00003 // Definition of eZWaitUntilDateValue class
00004 //
00005 // Created on: <14-ñÎ×-2003 14:49:06 sp>
00006 //
00007 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00008 // SOFTWARE NAME: eZ Publish
00009 // SOFTWARE RELEASE: 4.0.x
00010 // COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
00011 // SOFTWARE LICENSE: GNU General Public License v2.0
00012 // NOTICE: >
00013 //   This program is free software; you can redistribute it and/or
00014 //   modify it under the terms of version 2.0  of the GNU General
00015 //   Public License as published by the Free Software Foundation.
00016 //
00017 //   This program is distributed in the hope that it will be useful,
00018 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 //   GNU General Public License for more details.
00021 //
00022 //   You should have received a copy of version 2.0 of the GNU General
00023 //   Public License along with this program; if not, write to the Free
00024 //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00025 //   MA 02110-1301, USA.
00026 //
00027 //
00028 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00029 //
00030 
00031 /*! \file ezwaituntildatevalue.php
00032 */
00033 
00034 /*!
00035   \class eZWaitUntilDateValue ezwaituntildatevalue.php
00036   \brief The class eZWaitUntilDateValue does
00037 
00038 */
00039 
00040 //include_once( "kernel/classes/ezpersistentobject.php" );
00041 
00042 class eZWaitUntilDateValue extends eZPersistentObject
00043 {
00044     /*!
00045      Constructor
00046     */
00047     function eZWaitUntilDateValue( $row )
00048     {
00049         $this->eZPersistentObject( $row );
00050         $this->ClassName = null;
00051         $this->ClassAttributeName = null;
00052 
00053     }
00054 
00055     static 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         unset( $this->ClassName );
00118         unset( $this->ClassAttributeName );
00119     }
00120 
00121     static function create( $workflowEventID, $workflowEventVersion, $contentClassAttributeID, $contentClassID )
00122     {
00123         $row = array( "id" => null,
00124                       "workflow_event_id" => $workflowEventID,
00125                       "workflow_event_version" => $workflowEventVersion,
00126                       "contentclass_id" => $contentClassID,
00127                       "contentclass_attribute_id" => $contentClassAttributeID
00128                       );
00129         return new eZWaitUntilDateValue( $row );
00130     }
00131 
00132     static function createCopy( $id, $workflowEventID, $workflowEventVersion,  $contentClassID , $contentClassAttributeID )
00133     {
00134         $row = array( "id" => $id,
00135                       "workflow_event_id" => $workflowEventID,
00136                       "workflow_event_version" => $workflowEventVersion,
00137                       "contentclass_id" => $contentClassID,
00138                       "contentclass_attribute_id" => $contentClassAttributeID );
00139         return new eZWaitUntilDateValue( $row );
00140     }
00141 
00142 
00143     static function removeAllElements( $workflowEventID, $version )
00144     {
00145         eZPersistentObject::removeObject( eZWaitUntilDateValue::definition(),
00146                                           array( "workflow_event_id" => $workflowEventID,
00147                                                  "workflow_event_version" => $version) );
00148     }
00149 
00150     static function removeByID( $id , $version )
00151     {
00152         eZPersistentObject::removeObject( eZWaitUntilDateValue::definition(),
00153                                           array( "id" => $id,
00154                                                  "workflow_event_version" => $version) );
00155     }
00156 
00157     function fetch( $id, $version, $asObject = true )
00158     {
00159         return eZPersistentObject::fetchObject( eZWaitUntilDateValue::definition(),
00160                                                 null,
00161                                                 array( "id" => $id,
00162                                                        "workflow_event_version" => $version),
00163                                                 $asObject );
00164     }
00165 
00166     static function fetchAllElements( $workflowEventID, $version, $asObject = true )
00167     {
00168         return eZPersistentObject::fetchObjectList( eZWaitUntilDateValue::definition(),
00169                                                     null,
00170                                                     array( "workflow_event_id" => $workflowEventID,
00171                                                            "workflow_event_version" => $version ),
00172                                                     null,
00173                                                     null,
00174                                                     $asObject );
00175     }
00176 
00177     public $ClassName;
00178     public $ClassAttributeName;
00179 }
00180 
00181 ?>