XML format importer class from file storage.
More...
|
| cdata ($parser, $data) |
| Callback function.
|
|
| get_parser () |
| Creates and setups a SAX parser.
|
|
| tag_close ($parser, $tag) |
| Callback function.
|
|
| tag_open ($parser, $tag, $attributes) |
| Callback function.
|
|
|
bool | $check_schema |
| Boolean flag - whether or not to check that XML database schema matches the RDBMS database schema before importing (used by.
|
|
| $current_data |
|
| $current_data_is_null |
|
| $current_field |
|
| $current_row |
|
| $current_table |
|
string | $filepath |
| Path to the XML data file.
|
|
database_manager | $manager |
| Database manager of the target database (a.
|
|
moodle_database | $mdb |
| Connection to the target database (a.
|
|
xmldb_structure | $schema |
| Target database schema in XMLDB format (a.
|
|
moodle_transaction | $transaction |
| Transaction object.
|
|
string | $transactionmode = 'allinone' |
| How to use transactions.
|
|
XML format importer class from file storage.
◆ __construct()
file_xml_database_importer::__construct |
( |
| $filepath, |
|
|
moodle_database | $mdb, |
|
|
| $check_schema = true ) |
◆ begin_database_import()
database_importer::begin_database_import |
( |
| $version, |
|
|
| $timestamp ) |
|
inherited |
Callback function.
Should be called only once database per import operation, before any database changes are made. It will check the database schema if
- See also
- check_schema is true
- Exceptions
-
- Parameters
-
float | $version | the version of the system which generated the data |
string | $timestamp | the timestamp of the data (in ISO 8601) format. |
- Return values
-
◆ begin_table_import()
database_importer::begin_table_import |
( |
| $tablename, |
|
|
| $schemaHash ) |
|
inherited |
Callback function.
Should be called only once per table import operation, before any table changes are made. It will delete all table data.
- Exceptions
-
- Parameters
-
string | $tablename | - the name of the table that will be imported |
string | $schemaHash | - the hash of the xmldb_table schema of the table |
- Return values
-
◆ cdata()
xml_database_importer::cdata |
( |
| $parser, |
|
|
| $data ) |
|
protectedinherited |
Callback function.
Called by the XML parser for character data processing.
- Parameters
-
resource | $parser | XML parser resource. |
string | $data | character data to be processed |
- Return values
-
◆ finish_database_import()
database_importer::finish_database_import |
( |
| ) |
|
|
inherited |
Callback function.
Should be called only once database per import operation, after all database changes are made. It will commit changes.
- Return values
-
◆ finish_table_import()
database_importer::finish_table_import |
( |
| $tablename | ) |
|
|
inherited |
Callback function.
Should be called only once per table import operation, after all table changes are made. It will reset table sequences if any.
- Parameters
-
- Return values
-
◆ get_parser()
xml_database_importer::get_parser |
( |
| ) |
|
|
protectedinherited |
Creates and setups a SAX parser.
Subclasses should use this method to create the XML parser.
- Return values
-
resource | XML parser resource. |
◆ import_database()
file_xml_database_importer::import_database |
( |
| ) |
|
Common import method: it opens the file storage, creates the parser, feeds the XML parser with data, releases the parser and closes the file storage.
- Return values
-
Reimplemented from database_importer.
◆ import_table_data()
database_importer::import_table_data |
( |
| $tablename, |
|
|
| $data ) |
|
inherited |
Callback function.
Should be called only once per record import operation, only between
- See also
- begin_table_import and
-
finish_table_import calls. It will insert table data.
- Exceptions
-
- Parameters
-
string | $tablename | - the name of the table in which data will be imported |
object | $data | - data object (fields and values will be inserted into table) |
- Return values
-
◆ set_transaction_mode()
database_importer::set_transaction_mode |
( |
| $mode | ) |
|
|
inherited |
How to use transactions during the import.
- Parameters
-
string | $mode | 'pertable', 'allinone' or 'none'. |
◆ tag_close()
xml_database_importer::tag_close |
( |
| $parser, |
|
|
| $tag ) |
|
protectedinherited |
Callback function.
Called by the XML parser for closing tags processing.
- Parameters
-
resource | $parser | XML parser resource. |
string | $tag | name of opening tag |
- Return values
-
◆ tag_open()
xml_database_importer::tag_open |
( |
| $parser, |
|
|
| $tag, |
|
|
| $attributes ) |
|
protectedinherited |
Callback function.
Called by the XML parser for opening tags processing.
- Parameters
-
resource | $parser | XML parser resource. |
string | $tag | name of opening tag |
array | $attributes | set of opening tag XML attributes |
- Return values
-
◆ $check_schema
bool database_importer::$check_schema |
|
protectedinherited |
Boolean flag - whether or not to check that XML database schema matches the RDBMS database schema before importing (used by.
- See also
- begin_database_import).
◆ $manager
◆ $mdb
◆ $schema
Target database schema in XMLDB format (a.
- See also
- xmldb_structure object).
The documentation for this class was generated from the following file: