ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailingList Class Reference
+ Collaboration diagram for ilMailingList:

Public Member Functions

 __construct (ilObjUser $user, $id=0)
 insert ()
 update ()
 delete ()
 getAssignedEntries ()
 assignAddressbookEntry ($addr_id=0)
 deassignAddressbookEntry ($a_id=0)
 deassignAllEntries ()
 setId ($a_mail_id=0)
 getId ()
 setUserId ($a_user_id=0)
 getUserId ()
 setTitle ($a_title= '')
 getTitle ()
 setDescription ($a_description= '')
 getDescription ()
 setCreatedate ($_createdate= '0000-00-00 00:00:00')
 getCreatedate ()
 setChangedate ($a_changedate= '0000-00-00 00:00:00')
 getChangedate ()

Static Public Member Functions

static _isOwner ($a_ml_id, $a_usr_id)

Private Member Functions

 read ()

Private Attributes

 $mail_id = 0
 $user_id = 0
 $title = ''
 $description = ''
 $createdate = '0000-00-00 00:00:00'
 $changedate = '0000-00-00 00:00:00'
 $user = null
 $db = null

Detailed Description

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

Definition at line 30 of file class.ilMailingList.php.

Constructor & Destructor Documentation

ilMailingList::__construct ( ilObjUser  $user,
  $id = 0 
)

Definition at line 42 of file class.ilMailingList.php.

References $ilDB, $user, and read().

{
global $ilDB;
$this->db = $ilDB;
$this->user = $user;
$this->mail_id = $id;
$this->user_id = $this->user->getId();
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilMailingList::_isOwner (   $a_ml_id,
  $a_usr_id 
)
static

Definition at line 288 of file class.ilMailingList.php.

References $ilDB, $res, and $row.

Referenced by ilMailingListsGUI\mailToList(), ilMailingListsGUI\performDelete(), ilMailingListsGUI\performDeleteMembers(), ilMailingListsGUI\saveAssignmentForm(), ilMailingListsGUI\saveForm(), ilMailingListsGUI\showAssignmentForm(), and ilMailingListsGUI\showForm().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM addressbook_mlist
WHERE ml_id = %s
AND user_id =%s',
array('integer', 'integer'),
array($a_ml_id, $a_usr_id));
$row = $ilDB->fetchObject($res);
return is_object($row) ? true : false;
}

+ Here is the caller graph for this function:

ilMailingList::assignAddressbookEntry (   $addr_id = 0)

Definition at line 197 of file class.ilMailingList.php.

References getId().

{
$nextId = $this->db->nextId('addressbook_mlist_ass');
$statement = $this->db->manipulateF('
INSERT INTO addressbook_mlist_ass
( a_id,
ml_id,
addr_id
)
VALUES(%s,%s,%s )',
array('integer', 'integer', 'integer'),
array($nextId, $this->getId(), $addr_id));
return true;
}

+ Here is the call graph for this function:

ilMailingList::deassignAddressbookEntry (   $a_id = 0)

Definition at line 213 of file class.ilMailingList.php.

{
$statement = $this->db->manipulateF('
DELETE FROM addressbook_mlist_ass
WHERE a_id = %s',
array('integer'),
array($a_id));
return true;
}
ilMailingList::deassignAllEntries ( )

Definition at line 225 of file class.ilMailingList.php.

References getId().

Referenced by delete().

{
$statement = $this->db->manipulateF('
DELETE FROM addressbook_mlist_ass
WHERE ml_id = %s',
array('integer'),
array($this->getId()));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailingList::delete ( )

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

References deassignAllEntries(), getId(), and getUserId().

{
if ($this->mail_id && $this->user_id)
{
$statement = $this->db->manipulateF('
DELETE FROM addressbook_mlist
WHERE ml_id = %s
AND user_id = %s',
array('integer', 'integer'),
array($this->getId(), $this->getUserId()));
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

ilMailingList::getAssignedEntries ( )

Definition at line 169 of file class.ilMailingList.php.

References $res, $row, DB_FETCHMODE_OBJECT, and getId().

{
$res = $this->db->queryf('
SELECT * FROM addressbook_mlist_ass
INNER JOIN addressbook ON addressbook.addr_id = addressbook_mlist_ass.addr_id
WHERE ml_id = %s',
array('integer'),
array($this->getId()));
$entries = array();
$counter = 0;
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$entries[$counter] = array('a_id' => $row->a_id,
'addr_id' => $row->addr_id,
'login' => $row->login,
'email' => $row->email,
'firstname' => $row->firstname,
'lastname' => $row->lastname
);
++$counter;
}
return $entries;
}

+ Here is the call graph for this function:

ilMailingList::getChangedate ( )

Definition at line 283 of file class.ilMailingList.php.

References $changedate.

Referenced by update().

{
}

+ Here is the caller graph for this function:

ilMailingList::getCreatedate ( )

Definition at line 272 of file class.ilMailingList.php.

References $createdate.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilMailingList::getDescription ( )

Definition at line 264 of file class.ilMailingList.php.

References $description.

Referenced by insert(), and update().

{
}

+ Here is the caller graph for this function:

ilMailingList::getId ( )

Definition at line 240 of file class.ilMailingList.php.

References $mail_id.

Referenced by assignAddressbookEntry(), deassignAllEntries(), delete(), getAssignedEntries(), read(), and update().

{
}

+ Here is the caller graph for this function:

ilMailingList::getTitle ( )

Definition at line 256 of file class.ilMailingList.php.

References $title.

Referenced by insert(), and update().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilMailingList::getUserId ( )

Definition at line 248 of file class.ilMailingList.php.

References $user_id.

Referenced by delete(), insert(), read(), and update().

{
}

+ Here is the caller graph for this function:

ilMailingList::insert ( )

Definition at line 56 of file class.ilMailingList.php.

References getCreatedate(), getDescription(), getTitle(), and getUserId().

{
$nextId = $this->db->nextId('addressbook_mlist');
$statement = $this->db->manipulateF('
INSERT INTO addressbook_mlist
( ml_id,
user_id,
title,
description,
createdate,
changedate
)
VALUES(%s, %s, %s, %s, %s, %s)',
array( 'integer',
'integer',
'text',
'text',
'timestamp',
'timestamp'),
array( $nextId,
$this->getUserId(),
$this->getTitle(),
$this->getDescription(),
$this->getCreatedate(),
NULL
));
$this->mail_id = $nextId;
return true;
}

+ Here is the call graph for this function:

ilMailingList::read ( )
private

Definition at line 141 of file class.ilMailingList.php.

References $res, $row, DB_FETCHMODE_OBJECT, getId(), getUserId(), setChangedate(), setCreatedate(), setDescription(), setId(), setTitle(), and setUserId().

Referenced by __construct().

{
if ($this->getId() && $this->getUserId())
{
$res = $this->db->queryf('
SELECT * FROM addressbook_mlist
WHERE ml_id = %s
AND user_id =%s',
array('integer', 'integer'),
array($this->getId(), $this->getUserId()));
if (is_object($row))
{
$this->setId($row->ml_id);
$this->setUserId($row->user_id);
$this->setTitle($row->title);
$this->setDescription($row->description);
$this->setCreatedate($row->createdate);
$this->setChangedate($row->changedae);
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailingList::setChangedate (   $a_changedate = '0000-00-00 00:00:00')

Definition at line 276 of file class.ilMailingList.php.

Referenced by read().

:00:00')
{
if($a_changedate == '0000-00-00 00:00:00')
$this->changedate = NULL;
else
$this->changedate = $a_changedate;
}

+ Here is the caller graph for this function:

ilMailingList::setCreatedate (   $_createdate = '0000-00-00 00:00:00')

Definition at line 268 of file class.ilMailingList.php.

Referenced by read().

:00:00')
{
$this->createdate = $_createdate;
}

+ Here is the caller graph for this function:

ilMailingList::setDescription (   $a_description = '')

Definition at line 260 of file class.ilMailingList.php.

Referenced by read().

{
$this->description = $a_description;
}

+ Here is the caller graph for this function:

ilMailingList::setId (   $a_mail_id = 0)

Definition at line 236 of file class.ilMailingList.php.

Referenced by read().

{
$this->mail_id = $a_mail_id;
}

+ Here is the caller graph for this function:

ilMailingList::setTitle (   $a_title = '')

Definition at line 252 of file class.ilMailingList.php.

Referenced by read().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilMailingList::setUserId (   $a_user_id = 0)

Definition at line 244 of file class.ilMailingList.php.

Referenced by read().

{
$this->user_id = $a_user_id;
}

+ Here is the caller graph for this function:

ilMailingList::update ( )

Definition at line 88 of file class.ilMailingList.php.

References getChangedate(), getDescription(), getId(), getTitle(), and getUserId().

{
if ($this->mail_id && $this->user_id)
{
$statement = $this->db->manipulateF('
UPDATE addressbook_mlist
SET title = %s,
description = %s,
changedate = %s
WHERE ml_id = %s
AND user_id = %s',
array( 'text',
'text',
'timestamp',
'integer',
'integer'
),
array( $this->getTitle(),
$this->getDescription(),
$this->getChangedate(),
$this->getId(),
$this->getUserId()
));
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

Field Documentation

ilMailingList::$changedate = '0000-00-00 00:00:00'
private

Definition at line 37 of file class.ilMailingList.php.

Referenced by getChangedate().

ilMailingList::$createdate = '0000-00-00 00:00:00'
private

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

Referenced by getCreatedate().

ilMailingList::$db = null
private

Definition at line 40 of file class.ilMailingList.php.

ilMailingList::$description = ''
private

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

Referenced by getDescription().

ilMailingList::$mail_id = 0
private

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

Referenced by getId().

ilMailingList::$title = ''
private

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

Referenced by getTitle().

ilMailingList::$user = null
private

Definition at line 39 of file class.ilMailingList.php.

Referenced by __construct().

ilMailingList::$user_id = 0
private

Definition at line 33 of file class.ilMailingList.php.

Referenced by getUserId().


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