37 $set = $ilDB->query(
"SELECT user_id FROM notification".
38 " WHERE type = ".$ilDB->quote($type,
"integer").
39 " AND user_id = ".$ilDB->quote($user_id,
"integer").
40 " AND id = ".$ilDB->quote($id,
"integer"));
41 return (
bool)$ilDB->numRows($set);
57 $sql =
"SELECT user_id FROM notification".
58 " WHERE type = ".$ilDB->quote($type,
"integer").
59 " AND id = ".$ilDB->quote($id,
"integer");
60 if(!$ignore_threshold)
62 $sql .=
" AND (last_mail < ".$ilDB->quote(date(
"Y-m-d H:i:s",
63 strtotime(
"-".self::THRESHOLD.
"minutes")),
"timestamp").
64 " OR last_mail IS NULL";
67 $sql .=
" OR page_id <> ".$ilDB->quote($page_id,
"integer");
72 $set = $ilDB->query($sql);
73 while(
$row = $ilDB->fetchAssoc($set))
75 $user[] =
$row[
"user_id"];
95 $ilDB->query(
"DELETE FROM notification".
96 " WHERE type = ".$ilDB->quote($type,
"integer").
97 " AND user_id = ".$ilDB->quote($user_id,
"integer").
98 " AND id = ".$ilDB->quote($id,
"integer"));
103 "type" => array(
"integer", $type),
104 "user_id" => array(
"integer", $user_id),
105 "id" => array(
"integer", $id)
107 $ilDB->replace(
"notification", $fields, array());
123 $sql =
"UPDATE notification".
124 " SET last_mail = ".$ilDB->quote(date(
"Y-m-d H:i:s"),
"timestamp");
128 $sql .=
", page_id = ".$ilDB->quote($page_id,
"integer");
131 $sql .=
" WHERE type = ".$ilDB->quote($type,
"integer").
132 " AND id = ".$ilDB->quote($id,
"integer").
133 " AND ".$ilDB->in(
"user_id", $user_ids,
false,
"integer");
148 $ilDB->query(
"DELETE FROM notification".
149 " WHERE type = ".$ilDB->quote($type,
"integer").
150 " AND id = ".$ilDB->quote($id,
"integer"));
162 $ilDB->query(
"DELETE FROM notification".
163 " WHERE user_id = ".$ilDB->quote($user_id,
"integer"));