ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

◆ backupHistoryToXML()

ilChatroomConverter::backupHistoryToXML ( )

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

16 {
17 global $ilDB;
18
19 $res = $ilDB->query("
20 SELECT chat_id, room_id
21 FROM chat_room_messages
22 GROUP BY chat_id, room_id
23 ");
24
25 $chat_room_id_comb = array();
26
27 while( $row = $ilDB->fetchAssoc($res) )
28 {
29 $chat_room_id_comb[] = array( $row['chat_id'], $row['room_id'] );
30 }
31
32 foreach( $chat_room_id_comb as $combination )
33 {
34 $res = $ilDB->queryF("
35 SELECT *
36 FROM chat_room_messages
37 WHERE chat_id = %s
38 AND room_id = %s",
39
40 array( 'integer', 'integer' ),
41 array( $combination[0], $combination[1] )
42 );
43
44 $xml = new SimpleXMLElement('<entries />');
45 $xml->addAttribute('chat_id', $combination[0]);
46 $xml->addAttribute('room_id', $combination[1]);
47
48 while( $row = $ilDB->fetchAssoc($res) )
49 {
50 $child = $xml->addChild('entry', $row['message']);
51 $child->addAttribute('timestamp', $row['commit_timestamp']);
52 }
53
54 $xml->asXML();
55 }
56 }
global $ilDB

References $ilDB, $res, and $row.


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