Skip to content

Commit

Permalink
MDL-36986: Adding course_restored event trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
polothy committed Dec 3, 2012
1 parent 47dfbd9 commit bf989c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backup/util/plan/restore_plan.class.php
Expand Up @@ -156,6 +156,16 @@ public function execute() {
$this->controller->set_status(backup::STATUS_EXECUTING);
parent::execute();
$this->controller->set_status(backup::STATUS_FINISHED_OK);

events_trigger('course_restored', (object) array(
'courseid' => $this->get_courseid(), // The new course
'userid' => $this->get_userid(), // User doing the restore
'type' => $this->controller->get_type(), // backup::TYPE_* constant
'target' => $this->controller->get_target(), // backup::TARGET_* constant
'mode' => $this->controller->get_mode(), // backup::MODE_* constant
'operation' => $this->controller->get_operation(), // backup::OPERATION_* constant
'samesite' => $this->controller->is_samesite(),
));
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/db/events.php
Expand Up @@ -77,6 +77,7 @@
course_updated - object course table record
course_content_removed - object course table record + context property
course_deleted - object course table record + context property
course_restored - custom object with courseid, userid and restore information
user_enrolled - object record from user_enrolments table + courseid,enrol
user_enrol_modified - object record from user_enrolments table + courseid,enrol
Expand Down

0 comments on commit bf989c2

Please sign in to comment.