From 613b0ecb8dd6c0a2252acc6ec1ab8c5510774e58 Mon Sep 17 00:00:00 2001 From: steinm Date: Tue, 21 Dec 2010 17:41:05 +0000 Subject: [PATCH] - adding methods getNotificationsByGroup() and getNotificationsByUser() --- inc/inc.ClassDMS.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/inc/inc.ClassDMS.php b/inc/inc.ClassDMS.php index c878f114b..c79d0a33e 100644 --- a/inc/inc.ClassDMS.php +++ b/inc/inc.ClassDMS.php @@ -748,5 +748,31 @@ class LetoDMS_DMS { return $this->getKeywordCategory($this->db->getInsertID()); } /* }}} */ + /** + * Get all notifications for a group + * + * @param + * @return array array notifications + */ + function getNotificationsByGroup($group, $type=0) { /* {{{ */ + $queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ". + "WHERE `tblNotify`.`groupID` = ". $group->getID(); + if($type) { + $queryStr .= " AND `tblNotify`.`targetType` = ".$type; + } + + } /* }}} */ + + /** + * Get all notifications for a user + * + * @return array array notifications + */ + function getNotificationsByUser($user, $type) { /* {{{ */ + $queryStr = "SELECT `tblNotify`.* FROM `tblNotify` ". + "WHERE `tblNotify`.`userID` = ". $user->getID(); + + } /* }}} */ + } ?>