61 return $this->blocked ? $this->blocked : array();
71 return in_array($a_usr_id, $this->blocked) ?
true :
false;
80 public function block($a_usr_id)
84 if(in_array((
int) $a_usr_id,$this->blocked) or !((
int) $a_usr_id))
89 $statement = $this->db->manipulateF(
90 'INSERT INTO chat_blocked (chat_id, usr_id) VALUES (%s, %s)',
91 array(
'integer',
'integer'),
92 array($this->
id, $a_usr_id));
109 if(!in_array((
int) $a_usr_id,$this->blocked))
114 $statement = $this->db->manipulateF(
'
115 DELETE FROM chat_blocked
118 array(
'integer',
'integer'),
119 array($this->
id, $a_usr_id));
136 $res = $ilDB->queryf(
'
137 SELECT * FROM chat_blocked
140 array(
'integer',
'integer'),
141 array($a_chat_id, $a_usr_id));
145 return $res->numRows() ?
true :
false;
157 $statement = $ilDB->manipulateF(
'
158 DELETE FROM chat_blocked WHERE usr_id = %s',
160 array((
int) $a_usr_id));
174 $statement = $ilDB->manipulateF(
'
175 DELETE FROM chat_blocked WHERE chat_id = %s',
177 array((
int) $a_chat_id));
190 $this->blocked = array();
192 $res = $this->db->queryf(
'
193 SELECT * FROM chat_blocked WHERE chat_id = %s',
199 $this->blocked[] =
$row->usr_id;