예제 #1
0
 /**
  * Method used to get the full list of reminders.
  *
  * @access  public
  * @return  array The list of reminders
  */
 function getList()
 {
     $stmt = "SELECT\n                    *\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_level\n                 ORDER BY\n                    rem_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 array();
     } else {
         if (empty($res)) {
             return array();
         } else {
             $t = array();
             for ($i = 0; $i < count($res); $i++) {
                 // ignore reminders that have no actions set yet...
                 $actions = Reminder_Action::getList($res[$i]['rem_id']);
                 if (count($actions) == 0) {
                     continue;
                 }
                 $res[$i]['actions'] = $actions;
                 $t[] = $res[$i];
             }
             return $t;
         }
     }
 }
예제 #2
0
 /**
  * Method used to get the full list of reminders.
  *
  * @return  array The list of reminders
  */
 public static function getList()
 {
     $stmt = 'SELECT
                 *
              FROM
                 {{%reminder_level}}
              ORDER BY
                 rem_rank ASC';
     try {
         $res = DB_Helper::getInstance()->getAll($stmt);
     } catch (DbException $e) {
         return array();
     }
     if (empty($res)) {
         return array();
     }
     $t = array();
     foreach ($res as &$row) {
         // ignore reminders that have no actions set yet...
         $actions = Reminder_Action::getList($row['rem_id']);
         if (count($actions) == 0) {
             continue;
         }
         $row['actions'] = $actions;
         $t[] = $row;
         unset($row);
     }
     return $t;
 }