Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
core_question\external\search_shared_banks Class Reference
Inheritance diagram for core_question\external\search_shared_banks:

Static Public Member Functions

static execute (int $contextid, string $search='', array $requiredcapabilities=['use'],)
 Return ID and formatted name of question banks accessible by the user, in courses other than the one $contextid is in.
 
static execute_parameters ()
 Define parameters for external function.
 
static execute_returns ()
 Define return values.
 

Public Attributes

int const MAX_RESULTS = 20
 The maximum number of banks to return.
 

Static Protected Member Functions

static expand_capabilities (array $abbreviations)
 Expand a list of abbreviated capaibilities into an array of full capability strings.
 

Member Function Documentation

◆ execute()

static core_question\external\search_shared_banks::execute ( int $contextid,
string $search = '',
array $requiredcapabilities = ['use'] )
static

Return ID and formatted name of question banks accessible by the user, in courses other than the one $contextid is in.

Parameters
int$contextidContext ID of the current activity
string$searchString to filter results by question bank name
array$requiredcapabilitiesList of abbreviated capabilities to check, {
See also
self::expand_capabilities()}
Return values
array

◆ execute_parameters()

static core_question\external\search_shared_banks::execute_parameters ( )
static

Define parameters for external function.

Return values
external_function_parameters

◆ execute_returns()

static core_question\external\search_shared_banks::execute_returns ( )
static

Define return values.

Return values
external_single_structure

◆ expand_capabilities()

static core_question\external\search_shared_banks::expand_capabilities ( array $abbreviations)
staticprotected

Expand a list of abbreviated capaibilities into an array of full capability strings.

Each abbreviation must match a capability with the 'moodle/question:' prefix. Capabilities that have an "all" and "mine" variant will have both variants included in the returned array.

These abbreviations are copied from {

See also
question_has_capability_on()}
Parameters
array$abbreviationsAbbreviated capabilities. Must match capabilities with the 'moodle/question:' prefix.
Return values
arrayThe expanded capabilities

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