[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/classes/ -> ezcontentobjecttranslation.php (source)

   1  <?php
   2  //
   3  // Created on: <12-Jun-2002 16:25:40 bf>
   4  //
   5  // SOFTWARE NAME: eZ publish
   6  // SOFTWARE RELEASE: 3.9.0
   7  // BUILD VERSION: 17785
   8  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
   9  // SOFTWARE LICENSE: GNU General Public License v2.0
  10  // NOTICE: >
  11  //   This program is free software; you can redistribute it and/or
  12  //   modify it under the terms of version 2.0  of the GNU General
  13  //   Public License as published by the Free Software Foundation.
  14  //
  15  //   This program is distributed in the hope that it will be useful,
  16  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  17  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18  //   GNU General Public License for more details.
  19  //
  20  //   You should have received a copy of version 2.0 of the GNU General
  21  //   Public License along with this program; if not, write to the Free
  22  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23  //   MA 02110-1301, USA.
  24  //
  25  //
  26  
  27  /*!
  28    \class eZContentObjectTranslation ezcontentobjecttranslation.php
  29    \brief eZContentObjectTranslation handles translation a translation of content objects
  30    \ingroup eZKernel
  31  
  32    \sa eZContentObject eZContentObjectVersion eZContentObjectTranslation
  33  */
  34  
  35  class eZContentObjectTranslation
  36  {
  37      function eZContentObjectTranslation( $contentObjectID, $version, $languageCode )
  38      {
  39          $this->ContentObjectID = $contentObjectID;
  40          $this->Version = $version;
  41          $this->LanguageCode = $languageCode;
  42          $this->Locale = null;
  43      }
  44  
  45      function languageCode()
  46      {
  47          return $this->LanguageCode;
  48      }
  49  
  50      function attributes()
  51      {
  52          return array( 'contentobject_id',
  53                        'version',
  54                        'language_code',
  55                        'locale' );
  56      }
  57  
  58      function hasAttribute( $attribute )
  59      {
  60          return in_array( $attribute, $this->attributes() );
  61      }
  62  
  63      function &attribute( $attribute )
  64      {
  65          if ( $attribute == 'contentobject_id' )
  66              return $this->ContentObjectID;
  67          else if ( $attribute == 'version' )
  68              return $this->Version;
  69          else if ( $attribute == 'language_code' )
  70              return $this->LanguageCode;
  71          else if ( $attribute == 'locale' )
  72              return $this->locale();
  73          else
  74          {
  75              eZDebug::writeError( "Attribute '$attribute' does not exist", 'eZContentObjectTranslation::attribute' );
  76              $retValue = null;
  77              return $retValue;
  78          }
  79      }
  80  
  81      function &locale()
  82      {
  83          if ( $this->Locale !== null )
  84              return $this->Locale;
  85          include_once ( 'lib/ezlocale/classes/ezlocale.php' );
  86          $this->Locale =& eZLocale::instance( $this->LanguageCode );
  87          return $this->Locale;
  88      }
  89  
  90      /*!
  91       Returns the attributes for the current content object translation.
  92      */
  93      function &objectAttributes( $asObject = true )
  94      {
  95          $attributeList = eZContentObjectVersion::fetchAttributes( $this->Version, $this->ContentObjectID, $this->LanguageCode, $asObject );
  96          return $attributeList;
  97      }
  98  
  99      /// The content object identifier
 100      var $ContentObjectID;
 101      /// Contains the content object
 102      var $Version;
 103  
 104      /// Contains the language code for the current translation
 105      var $LanguageCode;
 106  }
 107  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7