Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcontentobjecttranslation.php
Go to the documentation of this file.
1 <?php
19 class eZContentObjectTranslation
20 {
21 public $Locale;
29 public function __construct( $contentObjectID, $version, $languageCode )
30 {
31 $this->ContentObjectID = $contentObjectID;
32 $this->Version = $version;
33 $this->LanguageCode = $languageCode;
34 $this->Locale = null;
35 }
36
37 function languageCode()
38 {
39 return $this->LanguageCode;
40 }
41
42 function attributes()
43 {
44 return array( 'contentobject_id',
45 'version',
46 'language_code',
47 'locale' );
48 }
49
50 function hasAttribute( $attribute )
51 {
52 return in_array( $attribute, $this->attributes() );
53 }
54
55 function attribute( $attribute )
56 {
57 if ( $attribute == 'contentobject_id' )
58 return $this->ContentObjectID;
59 else if ( $attribute == 'version' )
60 return $this->Version;
61 else if ( $attribute == 'language_code' )
62 return $this->LanguageCode;
63 else if ( $attribute == 'locale' )
64 return $this->locale();
65 else
66 {
67 eZDebug::writeError( "Attribute '$attribute' does not exist", __METHOD__ );
68 return null;
69 }
70 }
71
72 function locale()
73 {
74 if ( $this->Locale !== null )
75 return $this->Locale;
76 $this->Locale = eZLocale::instance( $this->LanguageCode );
77 return $this->Locale;
78 }
79
83 function objectAttributes( $asObject = true )
84 {
85 return eZContentObjectVersion::fetchAttributes( $this->Version, $this->ContentObjectID, $this->LanguageCode, $asObject );
86 }
87
89 public $ContentObjectID;
91 public $Version;
92
94 public $LanguageCode;
95 }
96 ?>
eZContentObjectTranslation
eZContentObjectTranslation handles translation a translation of content objects
Definition: ezcontentobjecttranslation.php:20
eZContentObjectTranslation\attributes
attributes()
Definition: ezcontentobjecttranslation.php:42
eZContentObjectTranslation\objectAttributes
objectAttributes( $asObject=true)
Definition: ezcontentobjecttranslation.php:83
eZContentObjectTranslation\locale
locale()
Definition: ezcontentobjecttranslation.php:72
eZContentObjectTranslation\$Locale
$Locale
Definition: ezcontentobjecttranslation.php:21
eZContentObjectTranslation\$ContentObjectID
$ContentObjectID
The content object identifier.
Definition: ezcontentobjecttranslation.php:89
eZContentObjectTranslation\$Version
$Version
Contains the content object.
Definition: ezcontentobjecttranslation.php:91
eZContentObjectTranslation\hasAttribute
hasAttribute( $attribute)
Definition: ezcontentobjecttranslation.php:50
eZContentObjectTranslation\__construct
__construct( $contentObjectID, $version, $languageCode)
Definition: ezcontentobjecttranslation.php:29
eZContentObjectTranslation\languageCode
languageCode()
Definition: ezcontentobjecttranslation.php:37
eZContentObjectTranslation\attribute
attribute( $attribute)
Definition: ezcontentobjecttranslation.php:55
eZContentObjectTranslation\$LanguageCode
$LanguageCode
Contains the language code for the current translation.
Definition: ezcontentobjecttranslation.php:94
eZContentObjectVersion\fetchAttributes
static fetchAttributes( $version, $contentObjectID, $language=false, $asObject=true)
Definition: ezcontentobjectversion.php:1260
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZLocale\instance
static instance( $localeString=false)
Definition: ezlocale.php:1536
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.