original_string: public function get_doc_url(\core_search\document $doc) {
          global $DB;
          $section = $DB->get_field('course_sections', 'section', ['id' => $doc->get('itemid')], MUST_EXIST);
          $format = course_get_format($doc->get('courseid'));
          return $format->get_view_url($section);
      }
code: public function get_doc_url(\core_search\document $doc) {
          global $DB;
          $section = $DB->get_field('course_sections', 'section', ['id' => $doc->get('itemid')], MUST_EXIST);
          $format = course_get_format($doc->get('courseid'));
          return $format->get_view_url($section);
      }
code_tokens: public function get_doc_url ( \ core_search \ document $ doc ) { global $ DB ; $ section = $ DB -> get_field ( 'course_sections' , 'section' , [ 'id' => $ doc -> get ( 'itemid' ) ] , MUST_EXIST ) ; $ format = course_get_format ( $ doc -> get ( 'courseid' ) ) ; return $ format -> get_view_url ( $ section ) ; }
docstring: Gets a link to the section.
  
  @param \core_search\document $doc
  @return \moodle_url
docstring_tokens: Gets a link to the section .