ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatroomConverter Class Reference

Class ilChatroomConverter. More...

+ Collaboration diagram for ilChatroomConverter:

Public Member Functions

 backupHistoryToXML ()

Detailed Description

Class ilChatroomConverter.

Author
Andreas Kordosz akord.nosp@m.osz@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 13 of file class.ilChatroomConverter.php.

Member Function Documentation

ilChatroomConverter::backupHistoryToXML ( )

Definition at line 15 of file class.ilChatroomConverter.php.

References $ilDB, $res, and $row.

{
global $ilDB;
$res = $ilDB->query("
SELECT chat_id, room_id
FROM chat_room_messages
GROUP BY chat_id, room_id
");
$chat_room_id_comb = array();
while( $row = $ilDB->fetchAssoc($res) )
{
$chat_room_id_comb[] = array( $row['chat_id'], $row['room_id'] );
}
foreach( $chat_room_id_comb as $combination )
{
$res = $ilDB->queryF("
SELECT *
FROM chat_room_messages
WHERE chat_id = %s
AND room_id = %s",
array( 'integer', 'integer' ),
array( $combination[0], $combination[1] )
);
$xml = new SimpleXMLElement('<entries />');
$xml->addAttribute('chat_id', $combination[0]);
$xml->addAttribute('room_id', $combination[1]);
while( $row = $ilDB->fetchAssoc($res) )
{
$child = $xml->addChild('entry', $row['message']);
$child->addAttribute('timestamp', $row['commit_timestamp']);
}
$xml->asXML();
}
}

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