mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-41219 course: Make properties of course_modinfo read-only
added phpdocs and unittests
This commit is contained in:
parent
cbd6b1fc63
commit
44ddd2a115
5 changed files with 216 additions and 62 deletions
|
@ -79,11 +79,7 @@ if ($token==="$inttoken") {
|
|||
if ($course = $DB->get_record('course', array('id' => $courseid))) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
|
||||
if (!isset($modinfo->instances[$componentname])) {
|
||||
$modinfo->instances[$componentname] = array();
|
||||
}
|
||||
|
||||
foreach ($modinfo->instances[$componentname] as $modinstanceid=>$cm) {
|
||||
foreach ($modinfo->get_instances_of($componentname) as $modinstanceid=>$cm) {
|
||||
if ($modinstanceid==$instanceid) {
|
||||
$context = context_module::instance($cm->id, IGNORE_MISSING);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue