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.

Differences Between: [Versions 400 and 403]

Document representation.

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

Defines 1 class


Class: document  - X-Ref

Respresents a document to index.

format_time_for_engine($timestamp)   X-Ref
Formats the timestamp according to the search engine needs.

return: string
param: int $timestamp

format_string_for_engine($string)   X-Ref
Formats the timestamp according to the search engine needs.

return: string
param: int $timestamp

import_time_from_engine($time)   X-Ref
Returns a timestamp from the value stored in the search engine.

return: int
param: string $time

get_text_format()   X-Ref
Overwritten to use markdown format as we use markdown for solr highlighting.

return: int

format_text($text)   X-Ref
Formats a text string coming from the search engine.

return: string HTML text to be renderer
param: string $text Text to format

apply_defaults()   X-Ref
Apply any defaults to unset fields before export. Called after document building, but before export.

Sub-classes of this should make sure to call parent::apply_defaults().

export_file_for_engine($file)   X-Ref
Export the data for the given file in relation to this document.

return: array
param: \stored_file $file The stored file we are talking about.