50 $this->user_id = $this->user->getId();
58 $nextId = $this->db->nextId(
'addressbook_mlist');
59 $statement = $this->db->manipulateF(
'
60 INSERT INTO addressbook_mlist
68 VALUES(%s, %s, %s, %s, %s, %s)',
83 $this->mail_id = $nextId;
90 if ($this->mail_id && $this->user_id)
92 $statement = $this->db->manipulateF(
'
93 UPDATE addressbook_mlist
120 public function delete()
122 if ($this->mail_id && $this->user_id)
126 $statement = $this->db->manipulateF(
'
127 DELETE FROM addressbook_mlist
130 array(
'integer',
'integer'),
145 $res = $this->db->queryf(
'
146 SELECT * FROM addressbook_mlist
149 array(
'integer',
'integer'),
171 $res = $this->db->queryf(
'
172 SELECT * FROM addressbook_mlist_ass
173 INNER JOIN addressbook ON addressbook.addr_id = addressbook_mlist_ass.addr_id
176 array($this->
getId()));
183 $entries[$counter] = array(
'a_id' =>
$row->a_id,
184 'addr_id' =>
$row->addr_id,
185 'login' =>
$row->login,
186 'email' =>
$row->email,
187 'firstname' =>
$row->firstname,
188 'lastname' =>
$row->lastname
199 $nextId = $this->db->nextId(
'addressbook_mlist_ass');
200 $statement = $this->db->manipulateF(
'
201 INSERT INTO addressbook_mlist_ass
207 array(
'integer',
'integer',
'integer'),
208 array($nextId, $this->
getId(), $addr_id));
216 $statement = $this->db->manipulateF(
'
217 DELETE FROM addressbook_mlist_ass
227 $statement = $this->db->manipulateF(
'
228 DELETE FROM addressbook_mlist_ass
231 array($this->
getId()));
236 public function setId($a_mail_id = 0)
238 $this->mail_id = $a_mail_id;
246 $this->user_id = $a_user_id;
254 $this->title = $a_title;
262 $this->description = $a_description;
270 $this->createdate = $_createdate;
278 if($a_changedate ==
'0000-00-00 00:00:00')
279 $this->changedate = NULL;
281 $this->changedate = $a_changedate;
288 public static function _isOwner($a_ml_id, $a_usr_id)
292 $res = $ilDB->queryf(
'
293 SELECT * FROM addressbook_mlist
296 array(
'integer',
'integer'),
297 array($a_ml_id, $a_usr_id));
301 return is_object(
$row) ?
true :
false;