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.

(no description)

File Size: 310 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: copy_helper  - X-Ref

Copy helper class.

process_formdata(\stdClass $formdata)   X-Ref
Process raw form data from copy_form.

param: \stdClass $formdata Raw formdata
return: \stdClass Processed data for use with create_copy

create_copy(\stdClass $copydata)   X-Ref
Creates a course copy.
Sets up relevant controllers and adhoc task.

param: \stdClass $copydata Course copy data from process_formdata
return: array $copyids The backup and restore controller ids

get_copies(int $userid, ?int $courseid = null)   X-Ref
Get the in progress course copy operations for a user.

param: int $userid User id to get the course copies for.
param: int|null $courseid The optional source course id to get copies for.
return: array $copies Details of the inprogress copies.

map_backupids_to_restore_controller(array $backuprecords)   X-Ref
Returns a mapping between copy controller IDs and the restore controller.
For example if there exists a copy with backup ID abc and restore ID 123
then this mapping will map both keys abc and 123 to the same (instantiated)
restore controller.

param: array $backuprecords An array of records from {backup_controllers}
return: array An array of mappings between backup ids and restore controllers

cleanup_orphaned_copy_controllers(array $backuprecords, int $age = MINSECS)   X-Ref
No description