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 402] [Versions 400 and 403]

Search area for Moodle courses.

Copyright: 2016 Skylar Kelty <S.Kelty@kent.ac.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 198 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: course  - X-Ref

Search area for Moodle courses.

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

return: \moodle_recordset|null Recordset or null if no change possible
param: int $modifiedfrom timestamp
param: \context|null $context Restriction context

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

return: \core_search\document
param: stdClass $record
param: array    $options

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

return: int
param: int $id The course instance id.

get_doc_url(\core_search\document $doc)   X-Ref
Link to the course.

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

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

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

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.

Should be overridden by each search area.

return: array

get_component_name()   X-Ref
Returns the moodle component name.

It might be the plugin name (whole frankenstyle name) or the core subsystem name.

return: string

get_doc_icon(\core_search\document $doc)   X-Ref
Returns an icon instance for the document.

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

get_category_names()   X-Ref
Returns a list of category names associated with the area.

return: array