Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
database_mover Class Reference
Inheritance diagram for database_mover:
database_exporter

Public Member Functions

 __construct (moodle_database $mdb_source, moodle_database $mdb_target, $check_schema=true, progress_trace $feedback=null)
 Object constructor.
 
 begin_database_export ($version, $release, $timestamp, $description)
 Callback function.
 
 begin_table_export (xmldb_table $table)
 Callback function.
 
 export_database ($description=null)
 Generic method to export the database.
 
 export_table_data (xmldb_table $table, $data)
 Callback function.
 
 finish_database_export ()
 Callback function.
 
 finish_table_export (xmldb_table $table)
 Callback function.
 
 set_transaction_mode ($mode)
 How to use transactions during the transfer.
 

Protected Attributes

bool $check_schema
 Boolean flag - whether or not to check that XML database schema matches the RDBMS database schema before exporting (used by.
 
progress_trace $feedback
 Progress tracing object.
 
database_importer $importer
 Importer object used to transfer data.
 
database_manager $manager
 Database manager of the source database (a.
 
moodle_database $mdb
 Connection to the source database (a.
 
xmldb_structure $schema
 Source database schema in XMLDB format (a.
 

Constructor & Destructor Documentation

◆ __construct()

database_mover::__construct ( moodle_database $mdb_source,
moodle_database $mdb_target,
$check_schema = true,
progress_trace $feedback = null )

Object constructor.

Parameters
moodle_database$mdb_sourceConnection to the source database (a
See also
moodle_database object).
Parameters
moodle_database$mdb_targetConnection to the target 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
progress_trace$feedbackProgress tracing object
See also
export_database).

Member Function Documentation

◆ begin_database_export()

database_mover::begin_database_export ( $version,
$release,
$timestamp,
$description )

Callback function.

Calls importer's begin_database_import callback method.

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.
Return values
void

Reimplemented from database_exporter.

◆ begin_table_export()

database_mover::begin_table_export ( xmldb_table $table)

Callback function.

Calls importer's begin_table_import callback method.

Parameters
xmldb_table$table- XMLDB object for the exported table
Return values
void

Reimplemented from database_exporter.

◆ export_database()

database_exporter::export_database ( $description = null)
inherited

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.

◆ export_table_data()

database_mover::export_table_data ( xmldb_table $table,
$data )

Callback function.

Calls importer's import_table_data callback method.

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

Reimplemented from database_exporter.

◆ finish_database_export()

database_mover::finish_database_export ( )

Callback function.

Calls importer's finish_database_import callback method.

Return values
void

Reimplemented from database_exporter.

◆ finish_table_export()

database_mover::finish_table_export ( xmldb_table $table)

Callback function.

Calls importer's finish_table_import callback method.

Parameters
xmldb_table$table- XMLDB object for the exported table
Return values
void

Reimplemented from database_exporter.

◆ set_transaction_mode()

database_mover::set_transaction_mode ( $mode)

How to use transactions during the transfer.

Parameters
string$mode'pertable', 'allinone' or 'none'.

Member Data Documentation

◆ $check_schema

bool database_exporter::$check_schema
protectedinherited

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

See also
export_database).

◆ $manager

database_manager database_exporter::$manager
protectedinherited

Database manager of the source database (a.

See also
database_manager object).

◆ $mdb

moodle_database database_exporter::$mdb
protectedinherited

Connection to the source database (a.

See also
moodle_database object).

◆ $schema

xmldb_structure database_exporter::$schema
protectedinherited

Source database schema in XMLDB format (a.

See also
xmldb_structure object).

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