Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Used while evaluating conditions in bulk. More...
Public Member Functions | |
__construct (\context $context) | |
Constructs for given context. More... | |
get_users_by_capability ($capability) | |
Gets users on course who have the specified capability. More... | |
Protected Attributes | |
array | $cache = array() |
Associative array of capability => result. | |
context | $context |
Course or module context. | |
Used while evaluating conditions in bulk.
This object caches get_users_by_capability results in case they are needed by multiple conditions.
core_availability\capability_checker::__construct | ( | \context | $context | ) |
Constructs for given context.
context | $context | Context |
core_availability\capability_checker::get_users_by_capability | ( | $capability | ) |
Gets users on course who have the specified capability.
Returns an array of user objects which only contain the 'id' field. If the same capability has already been checked (e.g. by another condition) then a cached result will be used.
More fields are not necessary because this code is only used to filter users from an existing list.
string | $capability | Required capability |
array | Associative array of user id => objects containing only id |