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

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Jan 15 20:50:45 GMT 2006


Author: oscar
Date: 2006-01-15 20:50:44 +0000 (Sun, 15 Jan 2006)
New Revision: 2792

Modified:
   plog/trunk/class/dao/commentscommon.class.php
Log:
No need to cache every comment separately when loading a bunch of them, we'll never be working with single comments anyway.

Modified: plog/trunk/class/dao/commentscommon.class.php
===================================================================
--- plog/trunk/class/dao/commentscommon.class.php	2006-01-15 20:43:39 UTC (rev 2791)
+++ plog/trunk/class/dao/commentscommon.class.php	2006-01-15 20:50:44 UTC (rev 2792)
@@ -113,13 +113,14 @@
 			$comments = $this->getMany( "article_id",
 			                            $artid,
 			                            CACHE_ARTICLE_COMMENTS_BYARTICLE,
-			                            Array( CACHE_ARTICLE_COMMENTS => "getId" ),
+			                            Array(),
 			                            $order,
 										"",
 			                            $page,
 			                            $itemsPerPage );			                           
 			                            
 			$result = Array();
+		
 			if( $comments ) {
 				// load the post to get the blog in order to get the time difference
 				$articles = new Articles();
@@ -261,7 +262,6 @@
 	            // update all the other posts
     	        $query = "UPDATE ".$this->getPrefix()."articles_comments SET parent_id = 0 WHERE parent_id = ".$commentid." AND article_id = ".$artid.";";
         	    $result = $this->Execute( $query );
-        	    $this->_cache->removeData( $comment->getId(), CACHE_ARTICLE_COMMENTS );
         	    $this->_cache->removeData( $comment->getArticleId(), CACHE_ARTICLE_COMMENTS_BYARTICLE );
         	    
         	    // update the blog and the article counters
@@ -317,7 +317,6 @@
         			
         	$comment->setStatus( $status );
         	if(($result = $this->update( $comment ))) {
-        		$this->_cache->setData( $comment->getId(), CACHE_ARTICLE_COMMENTS, $comment );
         		$this->_cache->removeData( $comment->getArticleId(), CACHE_ARTICLE_COMMENTS_BYARTICLE );
         	}
         	



More information about the pLog-svn mailing list