Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 75 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

view_component:: (4 methods):
  __construct()
  init()
  get_extra_joins()
  get_required_fields()


Class: view_component  - X-Ref

Abstract class to define functionality shared by all pluggable components used in the question bank view.

__construct(view $qbank)   X-Ref
Constructor.

param: view $qbank the question bank view we are helping to render.

init()   X-Ref
A chance for subclasses to initialise themselves, for example to load lang strings,
without having to override the constructor.


get_extra_joins()   X-Ref
Return an array 'table_alias' => 'JOIN clause' to bring in any data that
this feature requires.

The return values for all the features will be checked. It is OK if two
features join in the same table with the same alias and identical JOIN clauses.
If two features try to use the same alias with different joins, you get an error.
Tables included by default are question (alias q) and those defined in {@see view::get_required_joins()}

It is importnat that your join simply adds additional data (or NULLs) to the
existing rows of the query. It must not cause additional rows.

return: string[] 'table_alias' => 'JOIN clause'

get_required_fields()   X-Ref
Use table alias 'q' for the question table, or one of the
ones from get_extra_joins. Every field requested must specify a table prefix.

return: string[] fields required.