39 $set = $ilDB->query(
"SELECT user_id FROM notification".
40 " WHERE type = ".$ilDB->quote($type,
"integer").
41 " AND user_id = ".$ilDB->quote($user_id,
"integer").
42 " AND id = ".$ilDB->quote($id,
"integer"));
43 return (
bool)$ilDB->numRows($set);
59 $sql =
"SELECT user_id FROM notification".
60 " WHERE type = ".$ilDB->quote($type,
"integer").
61 " AND id = ".$ilDB->quote($id,
"integer");
62 if(!$ignore_threshold)
64 $sql .=
" AND (last_mail < ".$ilDB->quote(date(
"Y-m-d H:i:s",
65 strtotime(
"-".self::THRESHOLD.
"minutes")),
"timestamp").
66 " OR last_mail IS NULL";
69 $sql .=
" OR page_id <> ".$ilDB->quote($page_id,
"integer");
74 $set = $ilDB->query($sql);
75 while(
$row = $ilDB->fetchAssoc($set))
77 $user[] =
$row[
"user_id"];
97 $ilDB->query(
"DELETE FROM notification".
98 " WHERE type = ".$ilDB->quote($type,
"integer").
99 " AND user_id = ".$ilDB->quote($user_id,
"integer").
100 " AND id = ".$ilDB->quote($id,
"integer"));
105 "type" => array(
"integer", $type),
106 "user_id" => array(
"integer", $user_id),
107 "id" => array(
"integer", $id)
109 $ilDB->replace(
"notification", $fields, array());
125 $sql =
"UPDATE notification".
126 " SET last_mail = ".$ilDB->quote(date(
"Y-m-d H:i:s"),
"timestamp");
130 $sql .=
", page_id = ".$ilDB->quote($page_id,
"integer");
133 $sql .=
" WHERE type = ".$ilDB->quote($type,
"integer").
134 " AND id = ".$ilDB->quote($id,
"integer").
135 " AND ".$ilDB->in(
"user_id", $user_ids,
false,
"integer");
150 $ilDB->query(
"DELETE FROM notification".
151 " WHERE type = ".$ilDB->quote($type,
"integer").
152 " AND id = ".$ilDB->quote($id,
"integer"));
164 $ilDB->query(
"DELETE FROM notification".
165 " WHERE user_id = ".$ilDB->quote($user_id,
"integer"));