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.

Index teachers in a course

Author: Nathan Nguyen <nathannguyen@catalyst-au.net>
Copyright: Catalyst IT
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 218 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: course_teacher  - X-Ref

Search for user role assignment in a course

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_document_recordset($modifiedfrom = 0, \context $context = null)   X-Ref
Returns recordset containing required data attributes for indexing.

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

get_document($record, $options = array()   X-Ref
Returns document instances for each record in the recordset.

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

check_access($id)   X-Ref
Checking whether I can access a document

return: int
param: int $id user id

get_context_url(\core_search\document $doc)   X-Ref
Returns a url to the document context.

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

get_document_display_title(\core_search\document $doc)   X-Ref
Returns the user fullname to display as document title

return: string User fullname
param: \core_search\document $doc

get_user($itemid)   X-Ref
Get user based on role assignment id

return: mixed
param: int $itemid role assignment id

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

return: array

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

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