Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
tool_lpmigrate\framework_processor Class Reference

Processor class. More...

Public Member Functions

 __construct (framework_mapper $mapper, core\progress\base $progress=null)
 Constructor.
 
 get_cms_found ()
 Return a list of CMs found.
 
 get_cms_found_count ()
 Return the number of CMs found.
 
 get_course_competency_migrations ()
 Get the number of course migrations.
 
 get_course_competency_removals ()
 Get the number of removals.
 
 get_courses_found ()
 Return a list of courses found.
 
 get_courses_found_count ()
 Return the number of courses found.
 
 get_errors ()
 Return a list of errors.
 
 get_expected_course_competency_migrations ()
 Get the number of expected course migrations.
 
 get_expected_module_competency_migrations ()
 Get the number of expected course module migrations.
 
 get_missing_mappings ()
 Get the missing mappings.
 
 get_module_competency_migrations ()
 Get the number of course module migrations.
 
 get_module_competency_removals ()
 Get the number of removals.
 
 get_warnings ()
 Return a list of warnings.
 
 has_run ()
 Whether the processor has run.
 
 proceed ()
 Execute the whole task.
 
 set_allowedcourses (array $courseids)
 Set the IDs of the courses that are allowed.
 
 set_course_start_date_from ($value)
 Set the minimum start date for courses to be migrated.
 
 set_disallowedcourses (array $courseids)
 Set the IDs of the courses that are not allowed.
 
 set_remove_original_when_destination_already_present ($value)
 Set whether we should remove original competencies when the destination competency was already there.
 
 set_remove_when_mapping_is_missing ($value)
 Set whether we should remove unmapped competencies.
 

Protected Member Functions

 find_coursescompetencies ()
 Identifies what courses and their competencies to work with.
 
 find_modulecompetencies ()
 Identifies what course modules and their competencies to work with.
 
 log_error ($courseid, $competencyid, $cmid, $message)
 Log an error.
 
 log_warning ($courseid, $competencyid, $cmid, $message)
 Log a warning.
 
 process_courses ()
 Process each course individually.
 
 process_mapping ()
 Process the mapping.
 

Protected Attributes

array $allowedcourses = array()
 List of course IDs that can be migrated.
 
array $cmsfound = array()
 Course modules found.
 
integer $coursecompetencyexpectedmigrations = 0
 Number of migrations expected in courses.
 
integer $coursecompetencymigrations = 0
 Count of migrations in the course level.
 
integer $coursecompetencyremovals = 0
 Count of removals in the course level.
 
array $coursescompetencies = array()
 Indexed as courseid => competencyids.
 
array $coursescompetenciesoutcomes = array()
 Indexed as courseid => competencyid => ruleoutcome.
 
array $coursesfound = array()
 Courses found.
 
int $coursestartdatefrom = 0
 Minimum start date of courses that can be migrated.
 
array $disallowedcourses = array()
 List of course IDs that cannot be migrated.
 
array $errors = array()
 List of errors.
 
array $fromids = array()
 The IDs of the objects of origin.
 
framework_mapper $mapper
 The mapper.
 
array $mappings = array()
 The mapping originId => destinationId.
 
array $missingmappings = array()
 IDs of objects missing a mapping in origin, originId => true.
 
array $modulecompetencies = array()
 Indexed as courseid => cmid => competencyids.
 
array $modulecompetenciesoutcomes = array()
 Indexed as courseid => cmid => competencyid => ruleoutcome.
 
integer $modulecompetencyexpectedmigrations = 0
 Number of migrations expected in CMs.
 
integer $modulecompetencymigrations = 0
 Count of migrations in CMs.
 
integer $modulecompetencyremovals = 0
 Count of removals in CMs.
 
boolean $proceeded = false
 Has this processor run?
 
core progress base $progress
 The progress.
 
bool $removeoriginalwhenalreadypresent = false
 Whether to remove the original competency when its destination was already there.
 
bool $removewhenmappingismissing = false
 Whether to remove the competency from course, or cm, when a mapping is not found.
 
array $warnings = array()
 List of warnings.
 

Detailed Description

Processor class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

tool_lpmigrate\framework_processor::__construct ( framework_mapper $mapper,
core\progress\base $progress = null )

Constructor.

Parameters
framework_mapper$mapperThe mapper.
core\progress\base$progressThe progress object.

Member Function Documentation

◆ find_coursescompetencies()

tool_lpmigrate\framework_processor::find_coursescompetencies ( )
protected

Identifies what courses and their competencies to work with.

Return values
void

◆ find_modulecompetencies()

tool_lpmigrate\framework_processor::find_modulecompetencies ( )
protected

Identifies what course modules and their competencies to work with.

Return values
void

◆ get_cms_found()

tool_lpmigrate\framework_processor::get_cms_found ( )

Return a list of CMs found.

Return values
int

◆ get_cms_found_count()

tool_lpmigrate\framework_processor::get_cms_found_count ( )

Return the number of CMs found.

Return values
int

◆ get_course_competency_migrations()

tool_lpmigrate\framework_processor::get_course_competency_migrations ( )

Get the number of course migrations.

Return values
int

◆ get_course_competency_removals()

tool_lpmigrate\framework_processor::get_course_competency_removals ( )

Get the number of removals.

Return values
int

◆ get_courses_found()

tool_lpmigrate\framework_processor::get_courses_found ( )

Return a list of courses found.

Return values
int

◆ get_courses_found_count()

tool_lpmigrate\framework_processor::get_courses_found_count ( )

Return the number of courses found.

Return values
int

◆ get_errors()

tool_lpmigrate\framework_processor::get_errors ( )

Return a list of errors.

Return values
array

◆ get_expected_course_competency_migrations()

tool_lpmigrate\framework_processor::get_expected_course_competency_migrations ( )

Get the number of expected course migrations.

Return values
int

◆ get_expected_module_competency_migrations()

tool_lpmigrate\framework_processor::get_expected_module_competency_migrations ( )

Get the number of expected course module migrations.

Return values
int

◆ get_missing_mappings()

tool_lpmigrate\framework_processor::get_missing_mappings ( )

Get the missing mappings.

Return values
arrayWhere keys are origin IDs.

◆ get_module_competency_migrations()

tool_lpmigrate\framework_processor::get_module_competency_migrations ( )

Get the number of course module migrations.

Return values
int

◆ get_module_competency_removals()

tool_lpmigrate\framework_processor::get_module_competency_removals ( )

Get the number of removals.

Return values
int

◆ get_warnings()

tool_lpmigrate\framework_processor::get_warnings ( )

Return a list of warnings.

Return values
array

◆ has_run()

tool_lpmigrate\framework_processor::has_run ( )

Whether the processor has run.

Return values
boolean

◆ log_error()

tool_lpmigrate\framework_processor::log_error ( $courseid,
$competencyid,
$cmid,
$message )
protected

Log an error.

Parameters
int$courseidThe course ID.
int$competencyidThe competency ID.
int$cmidThe CM ID.
string$messageThe error message.
Return values
void

◆ log_warning()

tool_lpmigrate\framework_processor::log_warning ( $courseid,
$competencyid,
$cmid,
$message )
protected

Log a warning.

Parameters
int$courseidThe course ID.
int$competencyidThe competency ID.
int$cmidThe CM ID.
string$messageThe warning message.
Return values
void

◆ proceed()

tool_lpmigrate\framework_processor::proceed ( )

Execute the whole task.

Return values
void

◆ process_courses()

tool_lpmigrate\framework_processor::process_courses ( )
protected

Process each course individually.

Return values
void

◆ process_mapping()

tool_lpmigrate\framework_processor::process_mapping ( )
protected

Process the mapping.

Return values
void

◆ set_allowedcourses()

tool_lpmigrate\framework_processor::set_allowedcourses ( array $courseids)

Set the IDs of the courses that are allowed.

Parameters
array$courseids

◆ set_course_start_date_from()

tool_lpmigrate\framework_processor::set_course_start_date_from ( $value)

Set the minimum start date for courses to be migrated.

Parameters
int$valueTimestamp, or 0.

◆ set_disallowedcourses()

tool_lpmigrate\framework_processor::set_disallowedcourses ( array $courseids)

Set the IDs of the courses that are not allowed.

Parameters
array$courseids

◆ set_remove_original_when_destination_already_present()

tool_lpmigrate\framework_processor::set_remove_original_when_destination_already_present ( $value)

Set whether we should remove original competencies when the destination competency was already there.

Parameters
bool$value

◆ set_remove_when_mapping_is_missing()

tool_lpmigrate\framework_processor::set_remove_when_mapping_is_missing ( $value)

Set whether we should remove unmapped competencies.

Parameters
bool$value

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