Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.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