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 class eZContentObjectTranslation
00038 {
00039 function eZContentObjectTranslation( $contentObjectID, $version, $languageCode )
00040 {
00041 $this->ContentObjectID = $contentObjectID;
00042 $this->Version = $version;
00043 $this->LanguageCode = $languageCode;
00044 $this->Locale = null;
00045 }
00046
00047 function languageCode()
00048 {
00049 return $this->LanguageCode;
00050 }
00051
00052 function attributes()
00053 {
00054 return array( 'contentobject_id',
00055 'version',
00056 'language_code',
00057 'locale' );
00058 }
00059
00060 function hasAttribute( $attribute )
00061 {
00062 return in_array( $attribute, $this->attributes() );
00063 }
00064
00065 function &attribute( $attribute )
00066 {
00067 if ( $attribute == 'contentobject_id' )
00068 return $this->ContentObjectID;
00069 else if ( $attribute == 'version' )
00070 return $this->Version;
00071 else if ( $attribute == 'language_code' )
00072 return $this->LanguageCode;
00073 else if ( $attribute == 'locale' )
00074 return $this->locale();
00075 else
00076 {
00077 eZDebug::writeError( "Attribute '$attribute' does not exist", 'eZContentObjectTranslation::attribute' );
00078 $retValue = null;
00079 return $retValue;
00080 }
00081 }
00082
00083 function &locale()
00084 {
00085 if ( $this->Locale !== null )
00086 return $this->Locale;
00087 include_once( 'lib/ezlocale/classes/ezlocale.php' );
00088 $this->Locale =& eZLocale::instance( $this->LanguageCode );
00089 return $this->Locale;
00090 }
00091
00092
00093
00094
00095 function &objectAttributes( $asObject = true )
00096 {
00097 $attributeList = eZContentObjectVersion::fetchAttributes( $this->Version, $this->ContentObjectID, $this->LanguageCode, $asObject );
00098 return $attributeList;
00099 }
00100
00101
00102 var $ContentObjectID;
00103
00104 var $Version;
00105
00106
00107 var $LanguageCode;
00108 }
00109 ?>