ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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.

References $DIC, and user().

53  {
54  global $DIC;
55 
56  $this->db = $DIC['ilDB'];
57  $this->user = $a_user;
58  }
user()
Definition: user.php:4
global $DIC
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteTemporaryLists()

ilMailingLists::deleteTemporaryLists ( )

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

References getAll(), and ilMailingList\MODE_TEMPORARY.

144  {
145  foreach($this->getAll() as $mlist)
146  {
147  if($mlist->getMode() == ilMailingList::MODE_TEMPORARY)
148  {
149  $mlist->delete();
150  }
151  }
152  }
+ Here is the call graph for this function:

◆ get()

ilMailingLists::get (   $id = 0)

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

References user().

61  {
62  return new ilMailingList($this->user, $id);
63  }
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ getAll()

ilMailingLists::getAll ( )

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

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

Referenced by deleteTemporaryLists().

84  {
85  $res = $this->db->queryf('
86  SELECT * FROM addressbook_mlist
87  WHERE user_id = %s',
88  array('integer'), array($this->user->getId()));
89 
90  $entries = array();
91 
92  $counter = 0;
93  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
94  {
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  }
user()
Definition: user.php:4
$counter
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentMailingList()

ilMailingLists::getCurrentMailingList ( )
Returns
ilMailingList

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

References $ml.

139  {
140  return $this->ml;
141  }

◆ getSelected()

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

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

References $counter, array, and user().

66  {
67  $entries = array();
68 
69  if (is_array($a_ids) && !empty($a_ids))
70  {
71  $counter = 0;
72  while($id = @array_pop($a_ids))
73  {
74  $entries[$counter] = new ilMailingList($this->user, $id);
75 
76  ++$counter;
77  }
78  }
79 
80  return $entries;
81  }
user()
Definition: user.php:4
$counter
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ mailingListExists()

ilMailingLists::mailingListExists (   $a_list_name)

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

References setCurrentMailingList().

115  {
116  $ml_id = substr($a_list_name, strrpos($a_list_name, '_') + 1);
117 
118  if (!is_numeric($ml_id) || $ml_id <= 0)
119  {
120  return false;
121  }
122  else
123  {
124  $this->setCurrentMailingList($ml_id);
125  }
126 
127  return true;
128  }
+ Here is the call graph for this function:

◆ setCurrentMailingList()

ilMailingLists::setCurrentMailingList (   $id = 0)

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

Referenced by mailingListExists().

131  {
132  $this->ml = $this->get($id);
133  }
+ 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: