ILIAS  release_4-4 Revision
ilMailingLists Class Reference
+ Collaboration diagram for ilMailingLists:

Public Member Functions

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

Private Attributes

 $db = null
 
 $user = null
 
 $ml = null
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ilMailingLists::__construct ( ilObjUser  $a_user)

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

39  {
40  global $ilDB;
41 
42  $this->db = $ilDB;
43  $this->user = $a_user;
44  }

Member Function Documentation

◆ deleteTemporaryLists()

ilMailingLists::deleteTemporaryLists ( )

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

References getAll(), and ilMailingList\MODE_TEMPORARY.

127  {
128  foreach($this->getAll() as $mlist)
129  {
130  if($mlist->getMode() == ilMailingList::MODE_TEMPORARY)
131  {
132  $mlist->delete();
133  }
134  }
135  }
+ Here is the call graph for this function:

◆ get()

ilMailingLists::get (   $id = 0)

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

47  {
48  return new ilMailingList($this->user, $id);
49  }

◆ getAll()

ilMailingLists::getAll ( )

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

References $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by deleteTemporaryLists().

70  {
71  $res = $this->db->queryf('
72  SELECT * FROM addressbook_mlist
73  WHERE user_id = %s',
74  array('integer'), array($this->user->getId()));
75 
76  $entries = array();
77 
78  $counter = 0;
79  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
80  {
81  $tmpObj = new ilMailingList($this->user, 0);
82  $tmpObj->setId($row->ml_id);
83  $tmpObj->setUserId($row->user_id);
84  $tmpObj->setTitle($row->title);
85  $tmpObj->setDescription($row->description);
86  $tmpObj->setCreatedate($row->createdate);
87  $tmpObj->setChangedate($row->changedae);
88  $tmpObj->setMode($row->lmode);
89 
90  $entries[$counter] = $tmpObj;
91 
92  unset($tmpObj);
93 
94  ++$counter;
95  }
96 
97  return $entries;
98  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ getCurrentMailingList()

ilMailingLists::getCurrentMailingList ( )

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

References $ml.

Referenced by mailingListExists().

122  {
123  return $this->ml;
124  }
+ Here is the caller graph for this function:

◆ getSelected()

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

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

52  {
53  $entries = array();
54 
55  if (is_array($a_ids) && !empty($a_ids))
56  {
57  $counter = 0;
58  while($id = @array_pop($a_ids))
59  {
60  $entries[$counter] = new ilMailingList($this->user, $id);
61 
62  ++$counter;
63  }
64  }
65 
66  return $entries;
67  }

◆ mailingListExists()

ilMailingLists::mailingListExists (   $a_list_name)

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

References getCurrentMailingList(), and setCurrentMailingList().

101  {
102  $ml_id = substr($a_list_name, strrpos($a_list_name, '_') + 1);
103 
104  if (!is_numeric($ml_id) || $ml_id <= 0)
105  {
106  return false;
107  }
108  else
109  {
110  $this->setCurrentMailingList($ml_id);
111  if ($this->getCurrentMailingList()->getCreateDate() == '0000-00-00 00:00:00') return false;
112  }
113 
114  return true;
115  }
+ Here is the call graph for this function:

◆ setCurrentMailingList()

ilMailingLists::setCurrentMailingList (   $id = 0)

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

Referenced by mailingListExists().

118  {
119  $this->ml = $this->get($id);
120  }
+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilMailingLists::$db = null
private

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

◆ $ml

ilMailingLists::$ml = null
private

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

Referenced by getCurrentMailingList().

◆ $user

ilMailingLists::$user = null
private

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


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