[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/dao/customfields/ -> customfieldvalue.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/database/dbobject.class.php" );
   4  
   5      /**
   6       * Defines a value assigned to a custom field
   7       *
   8       * \ingroup DAO
   9       */
  10      class CustomFieldValue extends DbObject
  11      {
  12          var $_fieldId;
  13          var $_fieldValue;
  14          var $_id;
  15          var $_blogId;
  16          var $_articleId;
  17          var $_field;
  18      
  19  		function CustomFieldValue( $fieldId, $fieldValue, $articleId, $blogId, $id = -1 )
  20          {
  21              // constructor
  22              $this->DbObject();            
  23              // and save some other values
  24              $this->_fieldId = $fieldId;
  25              if( $fieldValue == null ) $fieldValue = "";
  26              $this->_fieldValue = $fieldValue;
  27              $this->_articleId = $articleId;
  28              $this->_id = $id;
  29              $this->_customField = null;
  30              $this->_blogId = $blogId;
  31              
  32              $this->_fields = Array(
  33                 "field_id" => "getFieldId",
  34                 "field_value" => "getValue",
  35                 "normalized_value" => "getNormalizedValue",
  36                 "blog_id" => "getBlogId",
  37                 "article_id" => "getArticleId"
  38              );
  39          }
  40          
  41          /**
  42           * @private
  43           */
  44  		function _loadFieldDefinition()
  45          {
  46              if( $this->_customField == null ) {
  47                  lt_include( PLOG_CLASS_PATH."class/dao/customfields/customfields.class.php" );
  48                  $customFields = new CustomFields();
  49                  $this->_customField = $customFields->getCustomField( $this->_fieldId );
  50              }
  51          }
  52          
  53  		function getBlogId()
  54          {
  55              return $this->_blogId;
  56          }
  57          
  58  		function getId()
  59          {
  60              return $this->_id;
  61          }
  62          
  63  		function setId( $id )
  64          {
  65              $this->_id = $id;
  66          }
  67          
  68  		function getFieldId()
  69          {
  70              return $this->_fieldId;
  71          }
  72          
  73  		function getArticleId()
  74          {
  75              return $this->_articleId;
  76          }
  77          
  78  		function getArticle()
  79          {
  80              if( $this->_article == null ) {
  81                  lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
  82                  $articles = new Articles();
  83                  $this->_article = $articles->getBlogArticle( $this->_articleId, $this->_blogId );
  84              }
  85              
  86              return( $this->_article );
  87          }
  88          
  89  		function getValue()
  90          {            
  91              return $this->_fieldValue;
  92          }
  93          
  94  		function setValue( $value )
  95          {
  96              $this->_fieldValue = $value;
  97          }
  98          
  99  		function getNormalizedValue()
 100          {
 101              lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 102              $filter = new Textfilter();
 103              return( $filter->normalizeText($this->getValue()));
 104          }
 105          
 106  		function getType()
 107          {
 108              $this->_loadFieldDefinition();
 109              return( $this->_customField->getType());
 110          }
 111          
 112  		function getDescription()
 113          {
 114              $this->_loadFieldDefinition();
 115              return( $this->_customField->getDescription());
 116          }
 117          
 118  		function getName()
 119          {
 120              $this->_loadFieldDefinition();
 121              return( $this->_customField->getName());            
 122          }
 123          
 124  		function getFieldDefinition()
 125          {
 126              return( $this->_customField );
 127          }
 128      }
 129  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics