56 $this->db = $DIC[
'ilDB'];
60 $this->user_id = $this->
user->getId();
62 $this->
setMode(self::MODE_ADDRESSBOOK);
69 $nextId = $this->db->nextId(
'addressbook_mlist');
70 $statement = $this->db->manipulateF(
72 INSERT INTO addressbook_mlist 81 VALUES(%s, %s, %s, %s, %s, %s, %s)',
99 $this->mail_id = $nextId;
106 if ($this->mail_id && $this->user_id) {
107 $statement = $this->db->manipulateF(
109 UPDATE addressbook_mlist 138 public function delete()
140 if ($this->mail_id && $this->user_id) {
143 $statement = $this->db->manipulateF(
145 DELETE FROM addressbook_mlist 148 array(
'integer',
'integer'),
161 $res = $this->db->queryf(
163 SELECT * FROM addressbook_mlist 166 array(
'integer',
'integer'),
172 if (is_object(
$row)) {
189 $res = $this->db->queryf(
190 'SELECT a_id, usr_data.usr_id FROM addressbook_mlist_ass INNER JOIN usr_data ON usr_data.usr_id = addressbook_mlist_ass.usr_id WHERE ml_id = %s',
192 array($this->
getId())
198 $entries[
$row->a_id] = array(
199 'a_id' =>
$row->a_id,
200 'usr_id' =>
$row->usr_id
214 $nextId = $this->db->nextId(
'addressbook_mlist_ass');
215 $this->db->manipulateF(
216 'INSERT INTO addressbook_mlist_ass (a_id, ml_id, usr_id) VALUES(%s, %s, %s)',
217 array(
'integer',
'integer',
'integer'),
218 array($nextId, $this->
getId(), $usr_id)
229 $this->db->manipulateF(
230 'DELETE FROM addressbook_mlist_ass WHERE a_id = %s',
242 $this->db->manipulateF(
243 'DELETE FROM addressbook_mlist_ass WHERE ml_id = %s',
245 array($this->
getId())
250 public function setId($a_mail_id = 0)
252 $this->mail_id = $a_mail_id;
260 $this->user_id = $a_user_id;
268 $this->title = $a_title;
276 $this->description = $a_description;
284 $this->createdate = $_createdate;
292 $this->changedate = $a_changedate;
299 public static function _isOwner($a_ml_id, $a_usr_id)
303 $ilDB = $DIC[
'ilDB'];
306 'SELECT * FROM addressbook_mlist WHERE ml_id = %s AND user_id =%s',
307 array(
'integer',
'integer'),
308 array($a_ml_id, $a_usr_id)
312 return is_object(
$row) ? true :
false;
317 $a_mode = (int) $a_mode;
318 if (in_array($a_mode, array(self::MODE_ADDRESSBOOK, self::MODE_TEMPORARY))) {
319 $this->mode = (int) $a_mode;
331 public static function removeAssignmentsByUserId($usr_id)
335 $ilDB = $DIC[
'ilDB'];
337 $ilDB->manipulate(
'DELETE FROM addressbook_mlist_ass WHERE usr_id = ' .
$ilDB->quote($usr_id,
'integer'));
setDescription($a_description='')
if(!array_key_exists('StateId', $_REQUEST)) $id
setCreatedate($_createdate)
foreach($_POST as $key=> $value) $res
setChangedate($a_changedate)
__construct(ilObjUser $user, $id=0)