You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apis/subsystems/enrol.md
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,19 @@ The method takes the following parameters:
223
223
$enrolplugin->add_default_instance($course->id);
224
224
```
225
225
226
+
### $enrol_plugin->add_custom_instance()
227
+
228
+
Add a new enrolment instance to a specific course with custom settings an returns the instance id. This method will create a new instance record in the `enrol` table with the specified settings.
Remove an enrolment instance form a course and invalidate all related user enrolments.
@@ -235,6 +248,11 @@ The method takes the following parameters:
235
248
$enrolplugin->delete_instance($instance);
236
249
```
237
250
251
+
### $enrol_plugin->is_csv_upload_supported()
252
+
253
+
Checks whether enrolment plugin is supported in CSV course upload. Defaults to false. Override this function in your enrolment plugin if you want it to
Copy file name to clipboardExpand all lines: docs/devupdate.md
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -502,3 +502,25 @@ See MDL-78934 for more details and changes applied.
502
502
### Removal of the `--skip-passed` option
503
503
504
504
The legacy (and custom) Behat `--skip-passed` option has been removed completely. Please, use the standard `--rerun` option that provides exactly the same (execution of failed scenarios only).
505
+
506
+
## Enrolment methods support in CSV course upload
507
+
508
+
As part of [MDL-78855](https://tracker.moodle.org/browse/MDL-78855) new methods have been created for `enrol_plugin` to explicitly mark those enrolment methods that are supported in CSV course upload
509
+
510
+
Example below for method to be supported:
511
+
512
+
```php title="CSV supported"
513
+
public function is_csv_upload_supported(): bool {
514
+
return true;
515
+
}
516
+
```
517
+
518
+
Also a new method has been created for `enrol_plugin` to create enrolment instance with custom settings
519
+
520
+
```php title="Add custom instance"
521
+
public function add_custom_instance(stdClass $course, ?array $fields = null): ?int {
522
+
return $this->add_instance($course, $fields);
523
+
}
524
+
```
525
+
526
+
In [MDL-73839](https://tracker.moodle.org/browse/MDL-73839) cohort enrolment method has been updated to support CSV course upload.
0 commit comments