ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatRecord Class Reference

Class ilChatRecord. More...

+ Collaboration diagram for ilChatRecord:

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 15745 2008-01-17 09:14:32Z akill

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.

References $error_msg.

{
}
ilChatRecord::getModeratorId ( )

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

References $moderator_id.

Referenced by startRecording().

{
}

+ 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, DB_FETCHMODE_ASSOC, getRecordId(), ilDBx\isDbError(), 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 (ilDBx::isDbError($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.

References $record_id.

Referenced by getRecord().

{
}

+ Here is the caller graph for this function:

ilChatRecord::getRefId ( )

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

References $ref_id.

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.

References $room_id.

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

{
}

+ 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
integerreference_id or object_id
booleantreat 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, DB_FETCHMODE_ASSOC, getRecord(), getRefId(), getRoomId(), ilDBx\isDbError(), 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 (ilDBx::isDbError($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(), ilDBx\isDbError(), 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 (ilDBx::isDbError($res)) die("ilChatRecord::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
$query = "SELECT LAST_INSERT_ID()";
$res = $this->ilias->db->query($query);
if (ilDBx::isDbError($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(), ilDBx\isDbError(), 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 (ilDBx::isDbError($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.

Referenced by getErrorMessage().

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.

Referenced by getModeratorId().

ilChatRecord::$record_id = 0

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

Referenced by getRecordId().

ilChatRecord::$ref_id = 0

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

Referenced by getRefId().

ilChatRecord::$room_id = 0

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

Referenced by getRoomId().


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