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

Public Member Functions

 __construct (moodle_database $mdb, $check_schema=true)
 begin_database_export ($version, $release, $timestamp, $description)
 begin_table_export (xmldb_table $table)
 finish_table_export (xmldb_table $table)
 finish_database_export ()
 export_table_data (xmldb_table $table, $data)
 export_database ($description=null)

Protected Attributes

 $mdb
 $manager
 $schema
 $check_schema

Detailed Description

Base class for database export operations. This class defines basic callbacks for export operations and implements the

See also:
export_database and methods generic export processing. In general, subclasses will override callback methods to provide specific output and (optionally)
export_database to add functionality. Between a single pair of calls to
begin_database_export and
finish_database_export, multiple non-overlapping pairs of calls may be made to
begin_table_export and
finish_database_export for different tables. Between one pair of calls to
begin_table_export and
finish_database_export multiple calls may be made to
export_table_data for the same table.

Definition at line 43 of file database_exporter.php.


Constructor & Destructor Documentation

__construct ( moodle_database mdb,
check_schema = true 
)

Object constructor.

Parameters:
moodle_database$mdbConnection to the source database (a
See also:
moodle_database object).
Parameters:
boolean$check_schema- whether or not to check that XML database schema matches the RDBMS database schema before exporting (used by
See also:
export_database).

Definition at line 66 of file database_exporter.php.

Here is the call graph for this function:


Member Function Documentation

begin_database_export ( version,
release,
timestamp,
description 
) [abstract]

Callback function. Should be called only once database per export operation, before any other export operations. Subclasses should export basic database information (version and timestamp).

Parameters:
float$versionthe version of the system which generating the data
string$releasemoodle release info
string$timestampthe timestamp of the data (in ISO 8601) format.
string$descriptiona user description of the data.
Returns:
void

Reimplemented in database_mover, and xml_database_exporter.

Here is the caller graph for this function:

begin_table_export ( xmldb_table table) [abstract]

Callback function. Should be called only once per table export operation, before any other table export operations. Subclasses should export basic database information (name and schema's hash).

Parameters:
xmldb_table$table- XMLDB object for the exported table
Returns:
void

Reimplemented in database_mover, and xml_database_exporter.

Here is the caller graph for this function:

export_database ( description = null)

Generic method to export the database. It checks the schema (if

See also:
$check_schema is true), queries the database and calls appropriate callbacks.
Exceptions:
dbtransfer_exceptionif any checking (e.g. database schema) fails
Parameters:
string$descriptiona user description of the data.

Reimplemented in file_xml_database_exporter, and string_xml_database_exporter.

Definition at line 131 of file database_exporter.php.

Here is the call graph for this function:

export_table_data ( xmldb_table table,
data 
) [abstract]

Callback function. Should be called only once per record export operation, only between

See also:
begin_table_export and
finish_table_export calls. It will insert table data. Subclasses should export basic record information (data values).
Parameters:
xmldb_table$table- XMLDB object of the table from which data was retrieved
object$data- data object (fields and values from record)
Returns:
void

Reimplemented in database_mover, and xml_database_exporter.

Here is the caller graph for this function:

finish_database_export ( ) [abstract]

Callback function. Should be called only once database per export operation, after all database export operations.

Reimplemented in database_mover, and xml_database_exporter.

Here is the caller graph for this function:

finish_table_export ( xmldb_table table) [abstract]

Callback function. Should be called only once per table export operation, after all other table export operations.

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

Reimplemented in database_mover, and xml_database_exporter.

Here is the caller graph for this function:


Field Documentation

$check_schema [protected]

Boolean flag - whether or not to check that XML database schema matches the RDBMS database schema before exporting (used by

See also:
export_database).

Definition at line 55 of file database_exporter.php.

$manager [protected]

Database manager of the source database (a

See also:
database_manager object).

Definition at line 47 of file database_exporter.php.

$mdb [protected]

Connection to the source database (a

See also:
moodle_database object).

Definition at line 45 of file database_exporter.php.

$schema [protected]

Source database schema in XMLDB format (a

See also:
xmldb_structure object).

Definition at line 49 of file database_exporter.php.


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