See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]
Course copy class. Handles procesing data submitted by UI copy form and sets up the course copy process.
Author: | Matt Porritt <mattp@catalyst-au.net> |
Copyright: | 2020 onward The Moodle Users Association <https://moodleassociation.org/> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 309 lines (12 kb) |
Included or required: | 0 times |
Referenced: | 1 time |
Includes or requires: | 0 files |
copy:: (6 methods):
__construct()
get_enrollment_roles()
get_copy_data()
create_copy()
filter_copies_course()
get_copies()
__construct(\stdClass $formdata) X-Ref |
Constructor for the class. param: \stdClass $formdata Data from the validated course copy form. |
get_enrollment_roles(\stdClass $formdata) X-Ref |
Extract the enrolment roles to keep in the copied course from the raw submitted form data. param: \stdClass $formdata Data from the validated course copy form. return: array $keptroles The roles to keep. |
get_copy_data(\stdClass $formdata) X-Ref |
Take the validated form data and extract the required information for copy operations. param: \stdClass $formdata Data from the validated course copy form. return: \stdClass $copydata Data required for course copy operations. |
create_copy() X-Ref |
Creates a course copy. Sets up relevant controllers and adhoc task. return: array $copyids THe backup and restore controller ids. |
filter_copies_course(array $copyrecords, int $courseid) X-Ref |
Filters an array of copy records by course ID. param: array $copyrecords param: int $courseid return: array $copies Filtered array of records. |
get_copies(int $userid, int $courseid=0) 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 $courseid The optional source course id to get copies for. return: array $copies Details of the inprogress copies. |