36 $set = $ilDB->query(
"SELECT user_id FROM notification".
37 " WHERE type = ".$ilDB->quote($type,
"integer").
38 " AND user_id = ".$ilDB->quote($user_id,
"integer").
39 " AND id = ".$ilDB->quote($id,
"integer"));
40 return (
bool)$ilDB->numRows($set);
56 $sql =
"SELECT user_id FROM notification".
57 " WHERE type = ".$ilDB->quote($type,
"integer").
58 " AND id = ".$ilDB->quote($id,
"integer");
59 if(!$ignore_threshold)
61 $sql .=
" AND (last_mail < ".$ilDB->quote(date(
"Y-m-d H:i:s",
62 strtotime(
"-".self::THRESHOLD.
"minutes")),
"timestamp").
63 " OR last_mail IS NULL";
66 $sql .=
" OR page_id <> ".$ilDB->quote($page_id,
"integer");
71 $set = $ilDB->query($sql);
72 while(
$row = $ilDB->fetchAssoc($set))
74 $user[] =
$row[
"user_id"];
94 $ilDB->query(
"DELETE FROM notification".
95 " WHERE type = ".$ilDB->quote($type,
"integer").
96 " AND user_id = ".$ilDB->quote($user_id,
"integer").
97 " AND id = ".$ilDB->quote($id,
"integer"));
102 "type" => array(
"integer", $type),
103 "user_id" => array(
"integer", $user_id),
104 "id" => array(
"integer", $id)
106 $ilDB->replace(
"notification", $fields, array());
122 $sql =
"UPDATE notification".
123 " SET last_mail = ".$ilDB->quote(date(
"Y-m-d H:i:s"),
"timestamp");
127 $sql .=
", page_id = ".$ilDB->quote($page_id,
"integer");
130 $sql .=
" WHERE type = ".$ilDB->quote($type,
"integer").
131 " AND id = ".$ilDB->quote($id,
"integer").
132 " AND ".$ilDB->in(
"user_id", $user_ids,
false,
"integer");
147 $ilDB->query(
"DELETE FROM notification".
148 " WHERE type = ".$ilDB->quote($type,
"integer").
149 " AND id = ".$ilDB->quote($id,
"integer"));
161 $ilDB->query(
"DELETE FROM notification".
162 " WHERE user_id = ".$ilDB->quote($user_id,
"integer"));