ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 ()

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

ilMailingLists::__construct ( ilObjUser  $a_user)

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

References $ilDB.

{
global $ilDB;
$this->db = $ilDB;
$this->user = $a_user;
}

Member Function Documentation

ilMailingLists::get (   $id = 0)

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

{
return new ilMailingList($this->user, $id);
}
ilMailingLists::getAll ( )

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

References $res, $row, and DB_FETCHMODE_OBJECT.

{
$res = $this->db->queryf('
SELECT * FROM addressbook_mlist
WHERE user_id = %s',
array('integer'), array($this->user->getId()));
$entries = array();
$counter = 0;
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$tmpObj = new ilMailingList($this->user, 0);
$tmpObj->setId($row->ml_id);
$tmpObj->setUserId($row->user_id);
$tmpObj->setTitle($row->title);
$tmpObj->setDescription($row->description);
$tmpObj->setCreatedate($row->createdate);
$tmpObj->setChangedate($row->changedae);
$entries[$counter] = $tmpObj;
unset($tmpObj);
++$counter;
}
return $entries;
}
ilMailingLists::getCurrentMailingList ( )

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

References $ml.

Referenced by mailingListExists().

{
return $this->ml;
}

+ Here is the caller graph for this function:

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

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

{
$entries = array();
if (is_array($a_ids) && !empty($a_ids))
{
$counter = 0;
while($id = @array_pop($a_ids))
{
$entries[$counter] = new ilMailingList($this->user, $id);
++$counter;
}
}
return $entries;
}
ilMailingLists::mailingListExists (   $a_list_name)

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

References getCurrentMailingList(), and setCurrentMailingList().

{
$ml_id = substr($a_list_name, strrpos($a_list_name, '_') + 1);
if (!is_numeric($ml_id) || $ml_id <= 0)
{
return false;
}
else
{
$this->setCurrentMailingList($ml_id);
if ($this->getCurrentMailingList()->getCreateDate() == '0000-00-00 00:00:00') return false;
}
return true;
}

+ Here is the call graph for this function:

ilMailingLists::setCurrentMailingList (   $id = 0)

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

Referenced by mailingListExists().

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

+ Here is the caller graph for this function:

Field Documentation

ilMailingLists::$db = null
private

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

ilMailingLists::$ml = null
private

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

Referenced by getCurrentMailingList().

ilMailingLists::$user = null
private

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


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