ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMailingLists Class Reference
+ Collaboration diagram for ilMailingLists:

Public Member Functions

 __construct (ilObjUser $a_user)
 ilMailingLists constructor. More...
 
 get ($id=0)
 
 getSelected ($a_ids=array())
 
 getAll ()
 
 mailingListExists ($a_list_name)
 
 setCurrentMailingList ($id=0)
 
 getCurrentMailingList ()
 
 deleteTemporaryLists ()
 

Private Attributes

 $db
 
 $user
 
 $ml = null
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 31 of file class.ilMailingLists.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailingLists::__construct ( ilObjUser  $a_user)

ilMailingLists constructor.

Parameters
ilObjUser$a_user

Definition at line 52 of file class.ilMailingLists.php.

53 {
54 global $DIC;
55
56 $this->db = $DIC['ilDB'];
57 $this->user = $a_user;
58 }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ deleteTemporaryLists()

ilMailingLists::deleteTemporaryLists ( )

Definition at line 140 of file class.ilMailingLists.php.

141 {
142 foreach ($this->getAll() as $mlist) {
143 if ($mlist->getMode() == ilMailingList::MODE_TEMPORARY) {
144 $mlist->delete();
145 }
146 }
147 }

References getAll(), and ilMailingList\MODE_TEMPORARY.

+ Here is the call graph for this function:

◆ get()

ilMailingLists::get (   $id = 0)

Definition at line 60 of file class.ilMailingLists.php.

61 {
62 return new ilMailingList($this->user, $id);
63 }

References user().

+ Here is the call graph for this function:

◆ getAll()

ilMailingLists::getAll ( )

Definition at line 81 of file class.ilMailingLists.php.

82 {
83 $res = $this->db->queryf(
84 '
85 SELECT * FROM addressbook_mlist
86 WHERE user_id = %s',
87 array('integer'),
88 array($this->user->getId())
89 );
90
91 $entries = array();
92
93 $counter = 0;
94 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
95 $tmpObj = new ilMailingList($this->user, 0);
96 $tmpObj->setId($row->ml_id);
97 $tmpObj->setUserId($row->user_id);
98 $tmpObj->setTitle($row->title);
99 $tmpObj->setDescription($row->description);
100 $tmpObj->setCreatedate($row->createdate);
101 $tmpObj->setChangedate($row->changedae);
102 $tmpObj->setMode($row->lmode);
103
104 $entries[$counter] = $tmpObj;
105
106 unset($tmpObj);
107
108 ++$counter;
109 }
110
111 return $entries;
112 }
foreach($_POST as $key=> $value) $res

References $res, ilDBConstants\FETCHMODE_OBJECT, and user().

Referenced by deleteTemporaryLists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentMailingList()

ilMailingLists::getCurrentMailingList ( )
Returns
ilMailingList

Definition at line 135 of file class.ilMailingLists.php.

136 {
137 return $this->ml;
138 }

References $ml.

◆ getSelected()

ilMailingLists::getSelected (   $a_ids = array())

Definition at line 65 of file class.ilMailingLists.php.

66 {
67 $entries = array();
68
69 if (is_array($a_ids) && !empty($a_ids)) {
70 $counter = 0;
71 while ($id = @array_pop($a_ids)) {
72 $entries[$counter] = new ilMailingList($this->user, $id);
73
74 ++$counter;
75 }
76 }
77
78 return $entries;
79 }

References user().

+ Here is the call graph for this function:

◆ mailingListExists()

ilMailingLists::mailingListExists (   $a_list_name)

Definition at line 114 of file class.ilMailingLists.php.

115 {
116 $ml_id = substr($a_list_name, strrpos($a_list_name, '_') + 1);
117
118 if (!is_numeric($ml_id) || $ml_id <= 0) {
119 return false;
120 } else {
121 $this->setCurrentMailingList($ml_id);
122 }
123
124 return true;
125 }

References setCurrentMailingList().

+ Here is the call graph for this function:

◆ setCurrentMailingList()

ilMailingLists::setCurrentMailingList (   $id = 0)

Definition at line 127 of file class.ilMailingLists.php.

128 {
129 $this->ml = $this->get($id);
130 }

Referenced by mailingListExists().

+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilMailingLists::$db
private

Definition at line 36 of file class.ilMailingLists.php.

◆ $ml

ilMailingLists::$ml = null
private

Definition at line 46 of file class.ilMailingLists.php.

Referenced by getCurrentMailingList().

◆ $user

ilMailingLists::$user
private

Definition at line 41 of file class.ilMailingLists.php.


The documentation for this class was generated from the following file: