$backup_unique_code = optional_param('backup_unique_code',0,PARAM_INT);
//Get and check course
- if (! $course = get_record("course", "id", $id)) {
+ if (! $course = $DB->get_record("course", array("id"=>$id))) {
print_error('invalidcourseid');
}
// To some reasons, course_startdateoffset value was lost during restoring
if (!$chatuser = $DB->get_record('chat_users', array('sid'=>$chat_sid))) {
print_error('notlogged', 'chat');
}
- if (!$chat = get_record('chat', 'id', $chatid)) {
+ if (!$chat = $DB->get_record('chat', array('id'=>$chatid))) {
error('Could not find that chat room!');
}
- if (!$course = get_record('course', 'id', $chat->course)) {
+ if (!$course = $DB->get_record('course', array('id'=>$chat->course))) {
error('Could not find the course this belongs to!');
}
$DB->delete_records_select('forum_posts', "discussion IN ($discussionssql AND f.type <> 'single') AND parent = 0", $params); // now the initial posts for non single simple
// finally all discussions except single simple forums
- delete_records_select('forum_discussions', "forum IN ($forumssql AND f.type <> 'single')", $params);
+ $DB->delete_records_select('forum_discussions', "forum IN ($forumssql AND f.type <> 'single')", $params);
// remove all grades from gradebook
if (empty($data->reset_gradebook_grades)) {