ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

13 {
14 global $DIC;
15
16 $res = $DIC->database()->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 = $DIC->database()->fetchAssoc($res)) {
25 $chat_room_id_comb[] = array($row['chat_id'], $row['room_id']);
26 }
27
28 foreach ($chat_room_id_comb as $combination) {
29 $res = $DIC->database()->queryF(
30 "
31 SELECT *
32 FROM chat_room_messages
33 WHERE chat_id = %s
34 AND room_id = %s",
35 array('integer', 'integer'),
36 array($combination[0], $combination[1])
37 );
38
39 $xml = new SimpleXMLElement('<entries />');
40 $xml->addAttribute('chat_id', $combination[0]);
41 $xml->addAttribute('room_id', $combination[1]);
42
43 while ($row = $DIC->database()->fetchAssoc($res)) {
44 $child = $xml->addChild('entry', $row['message']);
45 $child->addAttribute('timestamp', $row['commit_timestamp']);
46 }
47
48 $xml->asXML();
49 }
50 }
$xml
Definition: metadata.php:240
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res

References $DIC, $res, $row, and $xml.


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