Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
copy_helper Class Reference

Copy helper class. More...

Static Public Member Functions

static cleanup_orphaned_copy_controllers (array $backuprecords, int $age=MINSECS)
 Detects and deletes/fails controllers associated with a course copy that are in an invalid state.
 
static create_copy (\stdClass $copydata)
 Creates a course copy.
 
static get_copies (int $userid, ?int $courseid=null)
 Get the in progress course copy operations for a user.
 
static process_formdata (\stdClass $formdata)
 Process raw form data from copy_form.
 

Detailed Description

Copy helper class.

Author
Cameron Ball camer.nosp@m.on@c.nosp@m.amero.nosp@m.n172.nosp@m.9.xyz
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ cleanup_orphaned_copy_controllers()

static copy_helper::cleanup_orphaned_copy_controllers ( array $backuprecords,
int $age = MINSECS )
static

Detects and deletes/fails controllers associated with a course copy that are in an invalid state.

Parameters
array$backuprecordsAn array of records from {backup_controllers}
int$ageHow old a controller needs to be (in seconds) before its considered for cleaning
Return values
void

◆ create_copy()

static copy_helper::create_copy ( \stdClass $copydata)
static

Creates a course copy.

Sets up relevant controllers and adhoc task.

Parameters
stdClass$copydataCourse copy data from process_formdata
Return values
array\$copyidsThe backup and restore controller ids

◆ get_copies()

static copy_helper::get_copies ( int $userid,
?int $courseid = null )
static

Get the in progress course copy operations for a user.

Parameters
int$useridUser id to get the course copies for.
int | null$courseidThe optional source course id to get copies for.
Return values
array\$copiesDetails of the inprogress copies.

◆ process_formdata()

static copy_helper::process_formdata ( \stdClass $formdata)
static

Process raw form data from copy_form.

Parameters
stdClass$formdataRaw formdata
Return values
stdClassProcessed data for use with create_copy

The documentation for this class was generated from the following file: