Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

File Size: 131 lines (4 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 1 class

base_controller:: (8 methods):
  get_progress()
  set_progress()
  get_logger()
  add_logger()
  log()
  get_releasesession()
  set_copy()
  get_copy()


Class: base_controller  - X-Ref

Base class with shared stuff between backup controller and restore
controller.

get_progress()   X-Ref
Gets the progress reporter, which can be used to report progress within
the backup or restore process.

return: \core\progress\base Progress reporting object

set_progress(\core\progress\base $progress)   X-Ref
Sets the progress reporter.

param: \core\progress\base $progress Progress reporting object

get_logger()   X-Ref
Gets first logger in logging chain.

return: base_logger Logger

add_logger(base_logger $logger)   X-Ref
Inserts a new logger at end of logging chain.

param: base_logger $logger New logger to add

log($message, $level, $a = null, $depth = null, $display = false)   X-Ref
Logs data to the logger chain.


get_releasesession()   X-Ref
Returns the set value of releasesession.
This is used to indicate if the session should be closed during the backup/restore.

return: bool Indicates whether the session should be released.

set_copy(\stdClass $data)   X-Ref
Store extra data for course copy operations.

For a course copying these is data required to be passed to the restore step.
We store this data in its own section of the backup controller

param: \stdClass $data The course copy data.

get_copy()   X-Ref
Get the course copy data.

return: \stdClass