Moodle  2.2.1
http://www.collinsharper.com
moodle1_xml_handler Class Reference
Inheritance diagram for moodle1_xml_handler:
Collaboration diagram for moodle1_xml_handler:

Protected Member Functions

 open_xml_writer ($filename)
 close_xml_writer ()
 has_xml_writer ()
 write_xml ($element, array $data, array $attribs=array(), $parent= '/')
 make_sure_xml_exists ($filename, $rootelement=false, $content=array())

Protected Attributes

 $xmlfilename
 $xmlwriter

Detailed Description

Base backup conversion handler that generates an XML file

Definition at line 146 of file handlerlib.php.


Member Function Documentation

close_xml_writer ( ) [protected]

Close the XML writer

At the moment, the caller must close all tags before calling

Returns:
void

Reimplemented in moodle1_qtype_handler.

Definition at line 186 of file handlerlib.php.

Here is the caller graph for this function:

has_xml_writer ( ) [protected]

Checks if the XML writer has been opened by self::open_xml_writer()

Returns:
bool

Definition at line 200 of file handlerlib.php.

Here is the caller graph for this function:

make_sure_xml_exists ( filename,
rootelement = false,
content = array() 
) [protected]

Makes sure that a new XML file exists, or creates it itself

This is here so we can check that all XML files that the restore process relies on have been created by an executed handler. If the file is not found, this method can create it using the given $rootelement as an empty root container in the file.

Parameters:
string$filenamerelative file name like 'course/course.xml'
string | bool$rootelementroot element to use, false to not create the file
array$contentcontent of the root element
Returns:
bool true is the file existed, false if it did not

Definition at line 274 of file handlerlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

open_xml_writer ( filename) [protected]

Opens the XML writer - after calling, one is free to use $xmlwriter

Parameters:
string$filenameXML file name to write into
Returns:
void

Definition at line 160 of file handlerlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_xml ( element,
array data,
array attribs = array(),
parent = '/' 
) [protected]

Writes the given XML tree data into the currently opened file

Parameters:
string$elementthe name of the root element of the tree
array$datathe associative array of data to write
array$attribslist of additional fields written as attributes instead of nested elements
string$parentused internally during the recursion, do not set yourself

Definition at line 217 of file handlerlib.php.

Here is the call graph for this function:


Field Documentation

$xmlfilename [protected]

Definition at line 149 of file handlerlib.php.

$xmlwriter [protected]

Definition at line 152 of file handlerlib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations