ocs  2.3.6
About: OCS (Open Conference System) is a Web publishing tool that will create a complete Web presence for your scholarly conference.
  Fossies Dox: ocs-2.3.6.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

NotificationStatusDAO.inc.php
Go to the documentation of this file.
1 <?php
2 
15 //$Id$
16 
17 class NotificationStatusDAO extends DAO {
18  function &getSchedConfNotifications($userId) {
19  $returner = array();
20 
21  $result =& $this->retrieve(
22  'SELECT j.sched_conf_id AS sched_conf_id, n.sched_conf_id AS notification FROM sched_confs j LEFT JOIN notification_status n ON j.sched_conf_id = n.sched_conf_id AND n.user_id = ? ORDER BY j.seq',
23  $userId
24  );
25 
26  while (!$result->EOF) {
27  $row =& $result->GetRowAssoc(false);
28  $returner[$row['sched_conf_id']] = $row['notification'];
29  $result->moveNext();
30  }
31 
32  $result->Close();
33  unset($result);
34 
35  return $returner;
36  }
37 
44  function setSchedConfNotifications($schedConfId, $userId, $notificationStatus) {
45  return $this->update(
46  ($notificationStatus?'INSERT INTO notification_status (user_id, sched_conf_id) VALUES (?, ?)':
47  'DELETE FROM notification_status WHERE user_id = ? AND sched_conf_id = ?'),
48  array($userId, $schedConfId)
49  );
50  }
51 
56  function deleteNotificationStatusBySchedConf($schedConfId) {
57  return $this->update(
58  'DELETE FROM notification_status WHERE sched_conf_id = ?', $schedConfId
59  );
60  }
61 
67  return $this->update(
68  'DELETE FROM notification_status WHERE user_id = ?', $userId
69  );
70  }
71 
77  function &getNotifiableUsersBySchedConfId($schedConfId) {
78  $userDao =& DAORegistry::getDAO('UserDAO');
79 
80  $result =& $this->retrieve(
81  'SELECT u.* FROM users u, notification_status n WHERE u.user_id = n.user_id AND n.sched_conf_id = ?',
82  $schedConfId
83  );
84 
85  $returner = new DAOResultFactory($result, $userDao, '_returnUserFromRow');
86  return $returner;
87  }
88 
94  function getNotifiableUsersCount($schedConfId) {
95  $userDao =& DAORegistry::getDAO('UserDAO');
96 
97  $result =& $this->retrieve(
98  'SELECT count(*) FROM notification_status n WHERE n.sched_conf_id = ?',
99  $schedConfId
100  );
101 
102  $returner = $result->fields[0];
103 
104  $result->Close();
105  unset($result);
106 
107  return $returner;
108  }
109 }
110 
111 ?>
config TEMPLATE inc php
Definition: config.inc.php:4
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:30
setSchedConfNotifications($schedConfId, $userId, $notificationStatus)
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:62
Operations for retrieving and modifying users' sched conf notification status.
deleteNotificationStatusBySchedConf($schedConfId)
Wrapper around ADORecordSet providing "factory" features for generating objects from DAOs.
& getNotifiableUsersBySchedConfId($schedConfId)
& getDAO($name, $dbconn=null)
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:186