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

oscar at devel.plogworld.net oscar at devel.plogworld.net
Mon Feb 28 21:17:54 GMT 2005


Author: oscar
Date: 2005-02-28 21:17:54 +0000 (Mon, 28 Feb 2005)
New Revision: 1260

Modified:
   plog/trunk/class/dao/articlecategory.class.php
Log:
one extra method that might be good to have.

Modified: plog/trunk/class/dao/articlecategory.class.php
===================================================================
--- plog/trunk/class/dao/articlecategory.class.php	2005-02-28 21:13:19 UTC (rev 1259)
+++ plog/trunk/class/dao/articlecategory.class.php	2005-02-28 21:17:54 UTC (rev 1260)
@@ -41,6 +41,7 @@
 			$this->_parentId = $parentId;
 			$this->_description = $description;
 			$this->_lastModification = new Timestamp($lastModification);
+			$this->_articles = Array();
 		}
 
         /**
@@ -154,6 +155,26 @@
         }
 		
 		/**
+		 * returns the articles categorized here
+		 *
+		 * @param an array of Article obejcts
+		 */
+		function getArticles( $status = POST_STATUS_PUBLISHED )
+		{
+			if( !is_array( $this->_articles[$status] || $this->_articles[$status] == null ) {
+				$articles = new Articles();
+				// you've got to love these huge method calls...
+				$this->_articles = $articles->getBlogArticles( $this->getBlogId(), 
+				                                               -1, 
+															   -1,
+															   $this->getId(),
+															   $status );
+			}
+			
+			return( $this->_articles[$status] );
+		}
+		
+		/**
 		 * returns the id of the parent category
 		 *
 		 * @return The id of the parent category




More information about the pLog-svn mailing list