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

mark at devel.lifetype.net mark at devel.lifetype.net
Wed Jan 18 11:39:33 GMT 2006


Author: mark
Date: 2006-01-18 11:39:32 +0000 (Wed, 18 Jan 2006)
New Revision: 2816

Modified:
   plog/trunk/class/dao/articlecategories.class.php
Log:
Better cache handling in ArticleCategories

Modified: plog/trunk/class/dao/articlecategories.class.php
===================================================================
--- plog/trunk/class/dao/articlecategories.class.php	2006-01-18 04:11:53 UTC (rev 2815)
+++ plog/trunk/class/dao/articlecategories.class.php	2006-01-18 11:39:32 UTC (rev 2816)
@@ -214,9 +214,18 @@
         function deleteCategory( $categoryId, $blogId )
         {
         	$category = $this->getCategory( $categoryId, $blogId );
-        	if( $category ) {
-				if ( $this->delete( "id", $categoryId ) )
-					$this->_cache->removeData( $blogId, CACHE_ARTICLE_CATEGORIES_BLOG );        		
+        	if( $category ) 
+        	{
+				if ( $this->delete( "id", $categoryId ) ) 
+				{
+					$this->_cache->removeData( $categoryId, CACHE_ARTICLE_CATEGORIES );
+					$this->_cache->removeData( $blogId, CACHE_ARTICLE_CATEGORIES_BLOG );
+					$this->_cache->removeData( $category->getMangledName(), CACHE_ARTICLE_CATEGORIES_BYNAME );
+					foreach( $category->getArticles() as $article)
+					{
+						$this->_cache->removeData( $article->getId(), CACHE_ARTICLE_CATEGORIES_LINK );
+					}
+				}
         		return( true );
         	}
         	else



More information about the pLog-svn mailing list