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

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Jun 17 12:28:41 GMT 2006


Author: oscar
Date: 2006-06-17 12:28:40 +0000 (Sat, 17 Jun 2006)
New Revision: 3600

Modified:
   plog/trunk/class/dao/mylinkscategories.class.php
Log:
fixed an issue when removing link categories


Modified: plog/trunk/class/dao/mylinkscategories.class.php
===================================================================
--- plog/trunk/class/dao/mylinkscategories.class.php	2006-06-16 20:19:58 UTC (rev 3599)
+++ plog/trunk/class/dao/mylinkscategories.class.php	2006-06-17 12:28:40 UTC (rev 3600)
@@ -106,11 +106,12 @@
          */
         function deleteMyLinksCategory( $categoryId, $blogId )
         {
+	
         	$category = $this->getMyLinksCategory( $categoryId, $blogId );
         	if( $category ) {
         		if( $this->delete( "id", $categoryId )) {
         			$this->_cache->removeData( $category->getId(), CACHE_MYLINKCATEGORIES );
-        			$this->_cache->removeData( "all", CACHE_MYLINKCATEGORIES_ALL );
+        			$this->_cache->removeData( $blogId, CACHE_MYLINKCATEGORIES_ALL );
         		}
         	}
         	else
@@ -126,12 +127,17 @@
          */
         function deleteBlogMyLinksCategories( $blogId )
         {
-        	/**
-        	 * :TODO:
-        	 *
-        	 * clean all the caches!
-        	 */
-        	return( $this->delete( "blog_id", $blogId ));
+			$res = false;
+			$categories = $this->getMyLinksCategories( $blogId );
+        	if(( $res = $this->delete( "blog_id", $blogId ))) {
+        		$this->_cache->removeData( $blogId, CACHE_MYLINKCATEGORIES_ALL );	
+				// remove all other categories
+				foreach( $categories as $category  ) {
+					$this->_cache->removeData( $category->getId(), CACHE_MYLINKCATEGORIES );
+				}
+			}
+			
+			return( $res );
         }        
 
         /**



More information about the pLog-svn mailing list