Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Forum posts search area

Copyright: 2015 David Monllao {@link http://www.davidmonllao.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 322 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: post  - X-Ref

Forum posts search area.

get_document_recordset($modifiedfrom = 0, \context $context = null)   X-Ref
Returns recordset containing required data for indexing forum posts.

param: int $modifiedfrom timestamp
param: \context|null $context Optional context to restrict scope of returned results
return: moodle_recordset|null Recordset (or null if no results)

get_document($record, $options = array()   X-Ref
Returns the document associated with this post id.

param: stdClass $record Post info.
param: array    $options
return: \core_search\document

uses_file_indexing()   X-Ref
Returns true if this area uses file indexing.

return: bool

get_search_fileareas()   X-Ref
Return the context info required to index files for
this search area.

return: array

attach_files($document)   X-Ref
Add the forum post attachments.

param: document $document The current document
return: null

check_access($id)   X-Ref
Whether the user can access the document or not.

param: int $id Forum post id
return: bool

get_doc_url(\core_search\document $doc)   X-Ref
Link to the forum post discussion

param: \core_search\document $doc
return: \moodle_url

get_context_url(\core_search\document $doc)   X-Ref
Link to the forum.

param: \core_search\document $doc
return: \moodle_url

get_post($postid)   X-Ref
Returns the specified forum post from its internal cache.

param: int $postid
return: stdClass

get_forum($forumid)   X-Ref
Returns the specified forum checking the internal cache.

Store minimal information as this might grow.

param: int $forumid
return: stdClass

get_discussion($discussionid)   X-Ref
Returns the discussion checking the internal cache.

param: int $discussionid
return: stdClass

get_contexts_to_reindex_extra_sql()   X-Ref
Changes the context ordering so that the forums with most recent discussions are indexed
first.

return: string[] SQL join and ORDER BY

supports_group_restriction()   X-Ref
Confirms that data entries support group restrictions.

return: bool True