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.

Backup implementation for the (tool_log) logstore_database nested element.

Copyright: 2015 Damyon Wiese <damyon@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 98 lines (3 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

backup_logstore_database_nested_element:: (4 methods):
  __construct()
  get_iterator()
  set_source_db()
  get_source_db()


Class: backup_logstore_database_nested_element  - X-Ref

Custom subclass of backup_nested_element that iterates over an external DB connection.

__construct($name, $attributes = null, $finalelements = null)   X-Ref
Constructor - instantiates one backup_nested_element, specifying its basic info.

param: string $name name of the element
param: array  $attributes attributes this element will handle (optional, defaults to null)
param: array  $finalelements this element will handle (optional, defaults to null)

get_iterator($processor)   X-Ref
For sql or table datasources, this will iterate over the "external" DB connection
stored in this class instead of the default $DB. All other cases use the parent default.

param: object $processor the processor

set_source_db($db)   X-Ref
Set the database we want to use.

param: \moodle_database $db

get_source_db()   X-Ref
Get the database we want to use.

return: \moodle_database $db