ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatRecord Class Reference

Class ilChatRecord. More...

+ Collaboration diagram for ilChatRecord:

Public Member Functions

 __construct ($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="")
 starts a recording with a given title
 stopRecording ()
 stops current recording
 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 19587 2009-04-09 15:08:42Z jposselt

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

Constructor & Destructor Documentation

ilChatRecord::__construct (   $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:

Member Function Documentation

ilChatRecord::getDescription ( )

Definition at line 159 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 108 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 118 of file class.ilChatRecord.php.

References $ilDB, $res, $row, DB_FETCHMODE_ASSOC, getRecordId(), ilDB\isDbError(), setRecord(), and setRecordId().

Referenced by isRecording(), and startRecording().

{
global $ilDB;
if ($a_id != 0)
{
$this->setRecordId($a_id);
}
$res = $ilDB->queryf('
SELECT * FROM chat_records WHERE record_id = %s',
array('integer'), array($this->getRecordId()));
die("ilChatRecord::getRecord(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
$row = array();
//if ($ilDB->numRows($res) > 0)
if ($res->numRows() > 0)
{
$row = $res->fetchRow(DB_FETCHMODE_ASSOC);
}
$this->setRecord($row);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRecord::getRecordId ( )

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

References $record_id.

Referenced by getRecord(), and stopRecording().

{
}

+ Here is the caller graph for this function:

ilChatRecord::getRefId ( )

Definition at line 88 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 78 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 149 of file class.ilChatRecord.php.

{
return $this->data["title"];
}
ilChatRecord::isRecording ( )

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

References $ilDB, $res, DB_FETCHMODE_ASSOC, getRecord(), getRefId(), getRoomId(), ilDB\isDbError(), and setRecordId().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT record_id FROM chat_records
WHERE chat_id = %s
AND room_id = %s
AND start_time > %s
AND end_time = %s',
array('integer', 'integer', 'integer', 'integer'),
array($this->getRefId(), $this->getRoomId(), '0', '0'));
if (ilDB::isDbError($res)) die("ilChatRecord::isRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
//if ($ilDB->numRows($res) > 0)
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 154 of file class.ilChatRecord.php.

{
$this->data["description"] = $a_description;
}
ilChatRecord::setModeratorId (   $a_id)

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

{
$this->moderator_id = $a_id;
}
ilChatRecord::setRecord (   $a_data)

Definition at line 113 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 93 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 83 of file class.ilChatRecord.php.

Referenced by __construct().

{
$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 144 of file class.ilChatRecord.php.

{
$this->data["title"] = $a_title;
}
ilChatRecord::startRecording (   $a_title = "")

starts a recording with a given title

Parameters
stringtitle used for storage

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

References $ilDB, $res, DB_FETCHMODE_ASSOC, getModeratorId(), getRecord(), getRefId(), getRoomId(), ilDB\isDbError(), and setRecordId().

{
global $ilDB;
$next_id = $ilDB->nextId('chat_records');
$res = $ilDB->manipulateF('
INSERT INTO chat_records
(record_id, moderator_id, chat_id, room_id, title, start_time )
VALUES(%s, %s, %s, %s, %s,%s)',
array('integer', 'integer', 'integer', 'integer', 'text', 'integer'),
array($next_id, $this->getModeratorId(), $this->getRefId(), $this->getRoomId(), $a_title, time()));
die("ilChatRecord::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
//$res = $ilDB->query("SELECT LAST_INSERT_ID()");
//if (ilDB::isDbError($res)) die("ilChatRecord::startRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
if ($res->numRows() > 0)
//if ($ilDB->numRows($res) > 0)
{
$lastId = $res->fetchRow(DB_FETCHMODE_ASSOC);
$this->setRecordId($lastId[0]);
$this->getRecord();
}
}

+ Here is the call graph for this function:

ilChatRecord::stopRecording ( )

stops current recording

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

References $data, $ilDB, $res, getRecordId(), getRefId(), getRoomId(), ilDB\isDbError(), setRecord(), and setRecordId().

{
global $ilDB;
$res = $ilDB->manipulateF('
UPDATE chat_records
SET end_time = %s
WHERE chat_id = %s
AND room_id = %s
AND record_id = %s',
array('integer', 'integer', 'integer', 'integer'),
array(time(), $this->getRefId(), $this->getRoomId(), $this->getRecordId()));
die("ilChatRecord::stopRecording(): " . $res->getMessage() . "<br>SQL-Statement: ".$res);
$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 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 __construct().

ilChatRecord::$lng

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

Referenced by __construct().

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: