Public Member Functions | Data Fields

ilChatRecord Class Reference

Class ilChatRecord. More...

Public Member Functions

 ilChatRecord ($a_id=0)
 Constructor public.
 getErrorMessage ()
 setRoomId ($a_id)
 getRoomId ()
 setRefId ($a_id)
 getRefId ()
 setRecordId ($a_id)
 getRecordId ()
 setModeratorId ($a_id)
 getModeratorId ()
 setRecord ($a_data)
 getRecord ($a_id=0)
 setTitle ($a_title)
 getTitle ()
 setDescription ($a_description)
 getDescription ()
 startRecording ($a_title="")
 stopRecording ()
 isRecording ()

Data Fields

 $ilias
 $lng
 $error_msg
 $ref_id = 0
 $moderator_id = 0
 $room_id = 0
 $record_id = 0
 $data = array()

Detailed Description

Class ilChatRecord.

Author:
Jens Conze
Version:
Id:
class.ilChatRecord.php 13200 2007-02-05 11:52:19Z mjansen

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


Member Function Documentation

ilChatRecord::getDescription (  ) 

Definition at line 148 of file class.ilChatRecord.php.

        {
                return $this->data["description"];
        }

ilChatRecord::getErrorMessage (  ) 

Definition at line 68 of file class.ilChatRecord.php.

        {
                return $this->error_msg;
        }

ilChatRecord::getModeratorId (  ) 

Definition at line 104 of file class.ilChatRecord.php.

Referenced by startRecording().

        {
                return $this->moderator_id;
        }

Here is the caller graph for this function:

ilChatRecord::getRecord ( a_id = 0  ) 

Definition at line 113 of file class.ilChatRecord.php.

References $data, $res, getRecordId(), setRecord(), and setRecordId().

Referenced by isRecording(), and startRecording().

        {
                global $ilDB;
                
                if ($a_id != 0)
                {
                        $this->setRecordId($a_id);
                }

                $query = "SELECT * FROM chat_records WHERE 
                                        record_id = ".$ilDB->quote($this->getRecordId())."";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecord::getRecord(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);

                $data = array();
                if ($res->numRows() > 0)
                {
                        $data = $res->fetchRow(DB_FETCHMODE_ASSOC);
                }
                $this->setRecord($data);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilChatRecord::getRecordId (  ) 

Definition at line 95 of file class.ilChatRecord.php.

Referenced by getRecord().

        {
                return $this->record_id;
        }

Here is the caller graph for this function:

ilChatRecord::getRefId (  ) 

Definition at line 86 of file class.ilChatRecord.php.

Referenced by isRecording(), startRecording(), and stopRecording().

        {
                return $this->ref_id;
        }

Here is the caller graph for this function:

ilChatRecord::getRoomId (  ) 

Definition at line 77 of file class.ilChatRecord.php.

Referenced by isRecording(), startRecording(), and stopRecording().

        {
                return $this->room_id;
        }

Here is the caller graph for this function:

ilChatRecord::getTitle (  ) 

Definition at line 139 of file class.ilChatRecord.php.

        {
                return $this->data["title"];
        }

ilChatRecord::ilChatRecord ( a_id = 0  ) 

Constructor public.

Parameters:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

Definition at line 52 of file class.ilChatRecord.php.

References $ilias, $lng, and setRefId().

        {
                global $ilias,$lng;

                define(MAX_TIME,60*60*24);

                $this->ilias =& $ilias;
                $this->lng =& $lng;

                if ($a_id > 0)
                {
                        $this->setRefId($a_id);
                }
        }

Here is the call graph for this function:

ilChatRecord::isRecording (  ) 

Definition at line 196 of file class.ilChatRecord.php.

References $res, getRecord(), getRefId(), getRoomId(), and setRecordId().

        {
                global $ilDB;
                
                $query = "SELECT record_id FROM chat_records WHERE 
                                        chat_id = ".$ilDB->quote($this->getRefId())." AND 
                                        room_id = ".$ilDB->quote($this->getRoomId())." AND 
                                        start_time > 0 AND 
                                        end_time = 0";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecord::isRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);

                if ($res->numRows() > 0)
                {
                        $id = $res->fetchRow(DB_FETCHMODE_ASSOC);
                        $this->setRecordId($id["record_id"]);

                        $this->getRecord();
                        return true;
                }
                
                return false;
        }

Here is the call graph for this function:

ilChatRecord::setDescription ( a_description  ) 

Definition at line 144 of file class.ilChatRecord.php.

        {
                $this->data["description"] = $a_description;
        }

ilChatRecord::setModeratorId ( a_id  ) 

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

        {
                $this->moderator_id = $a_id;
        }

ilChatRecord::setRecord ( a_data  ) 

Definition at line 109 of file class.ilChatRecord.php.

Referenced by getRecord(), and stopRecording().

        {
                $this->data = $a_data;
        }

Here is the caller graph for this function:

ilChatRecord::setRecordId ( a_id  ) 

Definition at line 91 of file class.ilChatRecord.php.

Referenced by getRecord(), isRecording(), startRecording(), and stopRecording().

        {
                $this->record_id = $a_id;
        }

Here is the caller graph for this function:

ilChatRecord::setRefId ( a_id  ) 

Definition at line 82 of file class.ilChatRecord.php.

Referenced by ilChatRecord().

        {
                $this->ref_id = $a_id;
        }

Here is the caller graph for this function:

ilChatRecord::setRoomId ( a_id  ) 

Definition at line 73 of file class.ilChatRecord.php.

        {
                $this->room_id = $a_id;
        }

ilChatRecord::setTitle ( a_title  ) 

Definition at line 135 of file class.ilChatRecord.php.

        {
                $this->data["title"] = $a_title;
        }

ilChatRecord::startRecording ( a_title = ""  ) 

Definition at line 153 of file class.ilChatRecord.php.

References $res, getModeratorId(), getRecord(), getRefId(), getRoomId(), and setRecordId().

        {
                global $ilDB;
                
                $query = "INSERT INTO chat_records SET 
                                        moderator_id = ".$ilDB->quote($this->getModeratorId()).", 
                                        chat_id = ".$ilDB->quote($this->getRefId()).", 
                                        room_id = ".$ilDB->quote($this->getRoomId()).", 
                                        title = ".$ilDB->quote($a_title).", 
                                        start_time = '" . time() . "'";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecord::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);

                $query = "SELECT LAST_INSERT_ID()";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecord::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);

                if ($res->numRows() > 0)
                {
                        $lastId = $res->fetchRow();
                        $this->setRecordId($lastId[0]);

                        $this->getRecord();
                }
        }

Here is the call graph for this function:

ilChatRecord::stopRecording (  ) 

Definition at line 179 of file class.ilChatRecord.php.

References $data, $res, getRefId(), getRoomId(), setRecord(), and setRecordId().

        {
                global $ilDB;
                
                $query = "UPDATE chat_records SET 
                                        end_time = '" . time() . "' WHERE 
                                        chat_id = ".$ilDB->quote($this->getRefId())." AND 
                                        room_id = ".$ilDB->quote($this->getRoomId())."";
                $res = $this->ilias->db->query($query);
                if (DB::isError($res)) die("ilChatRecord::stopRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);

                $this->setRecordId(0);

                $data = array();
                $this->setRecord($data);
        }

Here is the call graph for this function:


Field Documentation

ilChatRecord::$data = array()

Definition at line 44 of file class.ilChatRecord.php.

Referenced by getRecord(), and stopRecording().

ilChatRecord::$error_msg

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

ilChatRecord::$ilias

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

Referenced by ilChatRecord().

ilChatRecord::$lng

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

Referenced by ilChatRecord().

ilChatRecord::$moderator_id = 0

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

ilChatRecord::$record_id = 0

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

ilChatRecord::$ref_id = 0

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

ilChatRecord::$room_id = 0

Definition at line 41 of file class.ilChatRecord.php.


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