コード例 #1
0
ファイル: class.faq.php プロジェクト: juliogallardo1326/proc
 /**
  * Method used to get the list of FAQ entries available in the system.
  *
  * @access  public
  * @return  array The list of news entries
  */
 function getList()
 {
     $stmt = "SELECT\n                    faq_id,\n                    faq_prj_id,\n                    faq_title,\n                    faq_rank\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "faq\n                 ORDER BY\n                    faq_rank ASC";
     $res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return "";
     } else {
         // get the list of associated support levels
         for ($i = 0; $i < count($res); $i++) {
             if (Customer::doesBackendUseSupportLevels($res[$i]['faq_prj_id'])) {
                 $res[$i]['support_levels'] = implode(", ", array_values(FAQ::getAssociatedSupportLevels($res[$i]['faq_prj_id'], $res[$i]['faq_id'])));
             }
         }
         return $res;
     }
 }