57 return $this->blocked ? $this->blocked : array();
62 return in_array($a_usr_id,$this->blocked) ?
true :
false;
68 if(in_array((
int) $a_usr_id,$this->blocked) or !((
int) $a_usr_id))
72 $query =
"INSERT INTO chat_blocked ".
73 "SET chat_id = ".$ilDB->quote($this->
id).
", ".
74 "usr_id = ".$ilDB->quote((
int) $a_usr_id).
"";
76 $this->db->query($query);
86 if(!in_array((
int) $a_usr_id,$this->blocked))
90 $query =
"DELETE FROM chat_blocked ".
91 "WHERE chat_id = ".$ilDB->quote($this->
id).
" ".
92 "AND usr_id = ".$ilDB->quote((
int) $a_usr_id).
"";
94 $this->db->query($query);
107 $query =
"SELECT * FROM chat_blocked ".
108 "WHERE chat_id = ".$ilDB->quote($a_chat_id).
" ".
109 "AND usr_id = ".$ilDB->quote($a_usr_id ).
"";
111 $res = $ilDB->query($query);
113 return $res->numRows() ?
true :
false;
121 $query =
"DELETE FROM chat_blocked ".
122 "WHERE usr_id = ".$ilDB->quote((
int) $a_usr_id).
"";
124 $ilDB->query($query);
132 $query =
"DELETE FROM chat_blocked ".
133 "WHERE chat_id = ".$ilDB->quote((
int) $a_chat_id).
"";
135 $ilDB->query($query);
146 $this->blocked = array();
148 $query =
"SELECT * FROM chat_blocked ".
149 "WHERE chat_id = ".$ilDB->quote($this->
id).
"";
151 $res = $this->db->query($query);
154 $this->blocked[] = $row->usr_id;