- adding methods getNotificationsByGroup() and getNotificationsByUser()

This commit is contained in:
steinm 2010-12-21 17:41:05 +00:00
parent 64521a544f
commit 613b0ecb8d

View File

@ -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();
} /* }}} */
}
?>