in classes/api/base.php [890:917]
protected function get_section($courseid, $userid) {
global $DB;
$section = $DB->get_record('local_onenote_user_sections', ['course_id' => $courseid, 'user_id' => $userid]);
// Need to make sure section actually exists in case user may have deleted it.
if ($section && $section->section_id) {
$onenotesection = $this->apicall('get', '/sections/'.$section->section_id);
try {
$onenotesection = $this->process_apicall_response($onenotesection);
if (!empty($onenotesection)) {
return $section;
}
} catch (\Exception $e) {
// Process apicall response will log any errors.
return null;
}
}
$this->sync_notebook_data();
$section = $DB->get_record('local_onenote_user_sections', ['course_id' => $courseid, 'user_id' => $userid]);
if ($section && $section->section_id) {
return $section;
}
return null;
}