Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_question\local\bank\context_to_string_translator Class Reference

Public Member Functions

 __construct ($contexts)
 context_to_string_translator constructor.
 
 context_to_string ($contextid)
 Context to string.
 
 string_to_context ($contextname)
 String to context.
 

Protected Member Functions

 generate_context_to_string_array ($contexts)
 Generate context to array.
 

Protected Attributes

array $contexttostringarray = []
 used to translate between contextids and strings for this context.
 

Constructor & Destructor Documentation

◆ __construct()

core_question\local\bank\context_to_string_translator::__construct ( $contexts)

context_to_string_translator constructor.

Parameters
context[]$contexts

Member Function Documentation

◆ context_to_string()

core_question\local\bank\context_to_string_translator::context_to_string ( $contextid)

Context to string.

Parameters
int$contextid
Return values
mixed

◆ generate_context_to_string_array()

core_question\local\bank\context_to_string_translator::generate_context_to_string_array ( $contexts)
protected

Generate context to array.

Parameters
context[]$contexts

◆ string_to_context()

core_question\local\bank\context_to_string_translator::string_to_context ( $contextname)

String to context.

Parameters
string$contextname
Return values
false|int|string

The documentation for this class was generated from the following file: