/**
  * Retrieved list of objects base on a given parameters - dynamic method: list_PaForumCategory()
  *
  *
  * Generated with the DalClassGenerator created by: 
  * Zoran Hron <*****@*****.**> 
  *
  * @param conditionalStatement = null
  * @param orderby = null
  * @param sort = null
  * @param limit = 0
  * @param fetchmode = DB_FETCHMODE_OBJECT
  * @result array of objects: PaForumCategory
  **/
 public function list_PaForumCategory($conditionalStatement = null, $orderby = null, $sort = null, $limit = 0, $fetchmode = DB_FETCHMODE_OBJECT)
 {
     $this->initialize($conditionalStatement, $orderby, $sort);
     // build MySQL query
     $sql = "SELECT * FROM { pa_forum_category } ";
     if ($conditionalStatement) {
         $sql .= "WHERE {$conditionalStatement}";
     }
     if ($orderby) {
         $sql .= " ORDER BY {$orderby}";
     }
     if ($sort) {
         $sql .= " {$sort}";
     }
     if ($limit) {
         $sql .= " LIMIT {$limit}";
     }
     $sql .= ";";
     // execute query
     $res = Dal::query($sql);
     $objects = array();
     // data found?
     if ($res->numRows() > 0) {
         // retrieve data objects
         while ($row = $res->fetchRow($fetchmode)) {
             if ($fetchmode == DB_FETCHMODE_OBJECT) {
                 $obj = new PaForumCategory();
                 $obj->populateFromObject($row);
                 $objects[] = $obj;
             } else {
                 $objects[] = $row;
             }
         }
     }
     return $objects;
 }