Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

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

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

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

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.

return: null
param: document $document The current document

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

return: bool
param: int $id Forum post id

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

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

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

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

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

return: stdClass
param: int $postid

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

Store minimal information as this might grow.

return: stdClass
param: int $forumid

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

return: stdClass
param: int $discussionid

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