Public Member Functions | Private Attributes

ilMailingLists Class Reference
[Services/Mail]

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 <mjansen@databay.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.

        {
                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.

        {
                $query = "SELECT * FROM addressbook_mailing_lists "
                                ."WHERE 1 "
                                ."AND user_id = " . $this->db->quote($this->user->getId()) . " ";
                $res = $this->db->query($query);

                $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.

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.

ilMailingLists::$user = null [private]

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


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