Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

XML format exporter class

Copyright: 2008 Andrei Bautu
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 98 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

xml_database_exporter:: (5 methods):
  begin_database_export()
  begin_table_export()
  finish_table_export()
  finish_database_export()
  export_table_data()


Class: xml_database_exporter  - X-Ref

XML format exporter class.
Provides logic for writing XML tags and data inside appropriate callbacks.
Subclasses should define XML data sinks.

begin_database_export($version, $release, $timestamp, $description)   X-Ref
Callback function. Outputs open XML PI and moodle_database opening tag.

param: float $version the version of the system which generating the data
param: string $release moodle release info
param: string $timestamp the timestamp of the data (in ISO 8601) format.
param: string $description a user description of the data.
return: void

begin_table_export(xmldb_table $table)   X-Ref
Callback function. Outputs table opening tag.

param: xmldb_table $table - XMLDB object for the exported table
return: void

finish_table_export(xmldb_table $table)   X-Ref
Callback function. Outputs table closing tag.

param: xmldb_table $table - XMLDB object for the exported table

finish_database_export()   X-Ref
Callback function. Outputs moodle_database closing tag.


export_table_data(xmldb_table $table, $data)   X-Ref
Callback function. Outputs record tag with field subtags and data.

param: xmldb_table $table - XMLDB object of the table from which data was retrieved
param: object $data - data object (fields and values from record)
return: void