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

oscar at devel.plogworld.net oscar at devel.plogworld.net
Sat Feb 26 23:04:51 GMT 2005


Author: oscar
Date: 2005-02-26 23:04:51 +0000 (Sat, 26 Feb 2005)
New Revision: 1222

Modified:
   plog/trunk/class/dao/bloginfo.class.php
   plog/trunk/class/dao/blogs.class.php
Log:
one more speed improvement...

Modified: plog/trunk/class/dao/bloginfo.class.php
===================================================================
--- plog/trunk/class/dao/bloginfo.class.php	2005-02-26 22:58:45 UTC (rev 1221)
+++ plog/trunk/class/dao/bloginfo.class.php	2005-02-26 23:04:51 UTC (rev 1222)
@@ -10,6 +10,7 @@
 	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 	include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 	include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
 
 	/**
 	 * This is the representation of a blog. It contains all the information we need to know,
@@ -58,7 +59,6 @@
             $this->_updateDate = "";
             $this->_totalPosts = 0;
             $this->_viewedTotal = 0;
-            $this->_ownerInfo = "";
             $this->_usersInfo = array();
             $this->_createTimestamp = "";
             $this->_updateTimestamp = "";
@@ -74,6 +74,7 @@
 			$this->_viewedTotal = null;
 			$this->_totalPosts = null;
 			$this->_createTimestamp = null;
+            $this->_ownerInfo = null;			
 		}
 
         /**
@@ -217,9 +218,17 @@
 		}
 
         /**
+		 * Gets information about the owner of this blog
+		 * @return return a UserInfo object which contains much more info about the owner of the blog
          */
-		function getOwnerInfo( )
+		function getOwnerInfo()
 		{
+			if( $this->_ownerInfo == null ) {
+				$users = new Users();
+				$ownerInfo = $users->getUserInfoFromId( $this->_owner );
+				$this->setOwnerInfo( $ownerInfo );			
+			}
+		
 			return $this->_ownerInfo;
 		}
 

Modified: plog/trunk/class/dao/blogs.class.php
===================================================================
--- plog/trunk/class/dao/blogs.class.php	2005-02-26 22:58:45 UTC (rev 1221)
+++ plog/trunk/class/dao/blogs.class.php	2005-02-26 23:04:51 UTC (rev 1222)
@@ -89,9 +89,6 @@
                                       $query_result["id"] );
 
 			// load information about the blog owner
-			$users = new Users();
-			$ownerInfo = $users->getUserInfoFromId( $query_result["owner_id"] );
-			$blogInfo->setOwnerInfo( $ownerInfo );
 			$blogInfo->setStatus( $query_result["status"] );
 
             return $blogInfo;




More information about the pLog-svn mailing list