[pLog-svn] r3527 - plog/trunk/class/dao

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Jun 3 23:30:21 GMT 2006


Author: oscar
Date: 2006-06-03 23:30:20 +0000 (Sat, 03 Jun 2006)
New Revision: 3527

Modified:
   plog/trunk/class/dao/article.class.php
Log:
$this->_fields and $this->_customFields had all got mixed up


Modified: plog/trunk/class/dao/article.class.php
===================================================================
--- plog/trunk/class/dao/article.class.php	2006-06-03 22:49:29 UTC (rev 3526)
+++ plog/trunk/class/dao/article.class.php	2006-06-03 23:30:20 UTC (rev 3527)
@@ -38,14 +38,13 @@
         var $_totalTrackbacks;
         var $_properties;
 		var $_timeOffset;
-		var $_fields;
+		var $_customFields;
 		var $_trackbacks;
 		var $_slug;
 		var $_nextArticle;
 		var $_prevArticle;
 		var $_globalCategory;
 		var $_inSummary;
-		var $_customFields;
 
         /**
          * Constructor.
@@ -95,7 +94,7 @@
 			//$this->_date = 0;
             $this->_properties = $properties;
 			$this->_timeOffset = 0;
-			$this->_fields = null;
+			$this->_customFields = null;
 			$this->_trackbacks = null;
 			$this->_userInfo = null;
 			$this->_blogInfo = null;
@@ -850,13 +849,13 @@
 		 */
 		function getCustomFields()
 		{
-			if( is_null($this->_customFields) ) {
+			if( is_null( $this->_customFields )) {
                 include_once( PLOG_CLASS_PATH.'class/dao/customfields/customfieldsvalues.class.php' );	
 				// get the custom fields
 				$customFields = new CustomFieldsValues();
 				$fields = $customFields->getArticleCustomFieldsValues( $this->getId(), $this->getBlog());
 				$this->setFields( $fields );
-			}						
+			}
 			
 			return $this->_customFields;
 		}
@@ -868,16 +867,17 @@
 		 * @return A CustomFieldValue object
 		 */
 		function getFieldObject( $fieldName )
-		{
+		{			
 			// if fields haven't been loaded yet, do so now
-			if( is_null($this->_fields) )
+			//if( is_null($this->_customFields) )
+			//if( !is_array( $this->_customFields ))
 				$this->getCustomFields();
 		
-			if ( !array_key_exists(  $fieldName, $this->_fields )) {
+			if ( !array_key_exists(  $fieldName, $this->_customFields )) {
 				return null;
 			}
 			
-			return $this->_fields["$fieldName"];
+			return $this->_customFields["$fieldName"];
 		}
 		
 		/**
@@ -889,11 +889,11 @@
 		function setFieldObject( $fieldValue )
 		{
 			// if fields haven't been loaded yet, do so now
-			if( is_null($this->_fields) )
+			if( is_null($this->_customFields) )
 				$this->getCustomFields();		
 		
 			$fieldName = $fieldValue->getName();
-			$this->_fields["$fieldName"] = $fieldValue;
+			$this->_customFields["$fieldName"] = $fieldValue;
 			
 			return true;
 		}



More information about the pLog-svn mailing list