ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 10 of file class.ilChatroomConverter.php.

Member Function Documentation

◆ backupHistoryToXML()

ilChatroomConverter::backupHistoryToXML ( )

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

References $ilDB, $res, $row, and array.

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

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