Skip to content

Commit

Permalink
add objectid mapping function
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaroWalter committed May 2, 2024
1 parent 1938d43 commit cdc7486
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/event/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ protected function init() {
$this->data['objecttable'] = 'moodleoverflow';
parent::init();
}

public static function get_objectid_mapping() {
return ['db' => 'moodleoverflow', 'restore' => 'moodleoverflow'];
}
}
9 changes: 9 additions & 0 deletions classes/event/discussion_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,13 @@ public static function get_name() {
return get_string('eventdiscussioncreated', 'mod_moodleoverflow');
}

public static function get_objectid_mapping() {
return ['db' => 'moodleoverflow_discussions', 'restore' => 'moodleoverflow_discussions'];
}

public static function get_other_mappint() {
$othermapped = [];
$othermapped['moodleoverflowid'] = ['db' => 'moodleoverflow', 'restore' => 'moodleoverflow'];
return $othermapped;
}
}
4 changes: 4 additions & 0 deletions classes/event/discussion_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,9 @@ public function get_description() {
public static function get_name() {
return get_string('eventdiscussionviewed', 'mod_moodleoverflow');
}

public static function get_objectid_mapping() {
return ['db' => 'moodleoverflow_discussions', 'restore' => 'moodleoverflow_discussions'];
}
}

11 changes: 11 additions & 0 deletions classes/event/post_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,15 @@ public function get_description() {
public static function get_name() {
return get_string('eventpostcreated', 'mod_moodleoverflow');
}

public static function get_objectid_mapping() {
return ['db' => 'moodleoverflow_posts', 'restore' => 'moodleoverflow_posts'];
}

public static function get_other_mapping() {
$othermapped = [];
$othermapped['moodleoverflowid'] = ['db' => 'moodleoverflow', 'restore' => 'moodleoverflow'];
$othermapped['discussionid'] = ['db' => 'moodleoverflow_discussions', 'restore' => 'moodleoverflow_discussions'];
return $othermapped;
}
}
11 changes: 11 additions & 0 deletions classes/event/rating_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,15 @@ public function get_description() {
public static function get_name() {
return get_string('eventratingcreated', 'mod_moodleoverflow');
}

public static function get_objectid_mapping() {
return ['db' => 'moodleoverflow_ratings', 'restore' => 'moodleoverflow_ratings'];
}

public static function get_other_mapping() {
$othermapped = [];
$othermapped['moodleoverflowid'] = ['db' => 'moodleoverflow', 'restore' => 'moodleoverflow'];
$othermapped['discussionid'] = ['db' => 'moodleoverflow_discussions', 'restore' => 'moodleoverflow_discussions'];
return $othermapped;
}
}
10 changes: 10 additions & 0 deletions classes/event/subscription_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,14 @@ public static function get_name() {
return get_string('eventsubscriptioncreated', 'mod_moodleoverflow');
}

public static function get_objectid_mapping() {
return ['db' => 'moodleoverflow_subscriptions', 'restore' => 'moodleoverflow_subscriptions'];
}

public static function get_other_mapping() {
$othermapped = [];
$othermapped['moodleoverflowid'] = ['db' => 'moodleoverflow', 'restore' => 'moodleoverflow'];
return $othermapped;
}

}

0 comments on commit cdc7486

Please sign in to comment.