Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
copy_helper Class Reference

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.
 

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: