original_string: public function get_doc_url(\core_search\document $doc) {
          $contextmodule = \context::instance_by_id($doc->get('contextid'));
          $params = array('id' => $contextmodule->instanceid, 'chapterid' => $doc->get('itemid'));
          return new \moodle_url('/mod/book/view.php', $params);
      }
code: public function get_doc_url(\core_search\document $doc) {
          $contextmodule = \context::instance_by_id($doc->get('contextid'));
          $params = array('id' => $contextmodule->instanceid, 'chapterid' => $doc->get('itemid'));
          return new \moodle_url('/mod/book/view.php', $params);
      }
code_tokens: public function get_doc_url ( \ core_search \ document $ doc ) { $ contextmodule = \ context :: instance_by_id ( $ doc -> get ( 'contextid' ) ) ; $ params = array ( 'id' => $ contextmodule -> instanceid , 'chapterid' => $ doc -> get ( 'itemid' ) ) ; return new \ moodle_url ( '/mod/book/view.php' , $ params ) ; }
docstring: Returns a url to the chapter.
  
  @param \core_search\document $doc
  @return \moodle_url
docstring_tokens: Returns a url to the chapter .