Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Interface for an event vault class. More...
Public Member Functions | |
get_action_events_by_course (stdClass $user, stdClass $course, $timesortfrom, $timesortto, event_interface $afterevent, $limitnum) | |
Retrieve an array of events for the given user filtered by the course and time constraints. More... | |
get_action_events_by_timesort (stdClass $user, $timesortfrom, $timesortto, event_interface $afterevent, $limitnum, $limittononsuspendedevents) | |
Retrieve an array of events for the given user and time constraints. More... | |
get_event_by_id ($id) | |
Retrieve an event for the given id. More... | |
get_events ( $timestartfrom=null, $timestartto=null, $timesortfrom=null, $timesortto=null, event_interface $timestartafterevent=null, event_interface $timesortafterevent=null, $limitnum=20, $type=null, array $usersfilter=null, array $groupsfilter=null, array $coursesfilter=null, array $categoriesfilter=null, $withduration=true, $ignorehidden=true, callable $filter=null) | |
Get all events restricted by various parameters, taking in to account user and group overrides. More... | |
Interface for an event vault class.
core_calendar\local\event\data_access\event_vault_interface::get_action_events_by_course | ( | stdClass | $user, |
stdClass | $course, | ||
$timesortfrom, | |||
$timesortto, | |||
event_interface | $afterevent, | ||
$limitnum | |||
) |
Retrieve an array of events for the given user filtered by the course and time constraints.
If using this function for pagination then you can provide the last event that you've seen ($afterevent) and it will be used to appropriately offset the result set so that you don't receive the same events again.
stdClass | $user | The user for whom the events belong |
stdClass | $course | The course to filter by |
int | $timesortfrom | Events with timesort from this value (inclusive) |
int | $timesortto | Events with timesort until this value (inclusive) |
event_interface | $afterevent | Only return events after this one |
int | $limitnum | Return at most this number of events |
action_event_interface |
Implemented in core_calendar\local\event\data_access\event_vault.
core_calendar\local\event\data_access\event_vault_interface::get_action_events_by_timesort | ( | stdClass | $user, |
$timesortfrom, | |||
$timesortto, | |||
event_interface | $afterevent, | ||
$limitnum, | |||
$limittononsuspendedevents | |||
) |
Retrieve an array of events for the given user and time constraints.
If using this function for pagination then you can provide the last event that you've seen ($afterevent) and it will be used to appropriately offset the result set so that you don't receive the same events again.
stdClass | $user | The user for whom the events belong |
int | $timesortfrom | Events with timesort from this value (inclusive) |
int | $timesortto | Events with timesort until this value (inclusive) |
event_interface | $afterevent | Only return events after this one |
int | $limitnum | Return at most this number of events |
bool | $lmittononsuspendedevents | Limit course events to courses the user is active in (not suspended). |
event_interface |
Implemented in core_calendar\local\event\data_access\event_vault.
core_calendar\local\event\data_access\event_vault_interface::get_event_by_id | ( | $id | ) |
Retrieve an event for the given id.
int | $id | The event id |
event_interface|false |
Implemented in core_calendar\local\event\data_access\event_vault.
core_calendar\local\event\data_access\event_vault_interface::get_events | ( | $timestartfrom = null , |
|
$timestartto = null , |
|||
$timesortfrom = null , |
|||
$timesortto = null , |
|||
event_interface | $timestartafterevent = null , |
||
event_interface | $timesortafterevent = null , |
||
$limitnum = 20 , |
|||
$type = null , |
|||
array | $usersfilter = null , |
||
array | $groupsfilter = null , |
||
array | $coursesfilter = null , |
||
array | $categoriesfilter = null , |
||
$withduration = true , |
|||
$ignorehidden = true , |
|||
callable | $filter = null |
||
) |
Get all events restricted by various parameters, taking in to account user and group overrides.
int | null | $timestartfrom | Events with timestart from this value (inclusive). |
int | null | $timestartto | Events with timestart until this value (inclusive). |
int | null | $timesortfrom | Events with timesort from this value (inclusive). |
int | null | $timesortto | Events with timesort until this value (inclusive). |
event_interface | null | $timestartafterevent | Restrict the events in the timestart range to ones after this one. |
event_interface | null | $timesortafterevent | Restrict the events in the timesort range to ones after this one. |
int | $limitnum | Return at most this number of events. |
int | null | $type | Return only events of this type. |
array | null | $usersfilter | Return only events for these users. |
array | null | $groupsfilter | Return only events for these groups. |
array | null | $coursesfilter | Return only events for these courses. |
bool | $withduration | If true return only events starting within specified timestart otherwise return in progress events as well. |
bool | $ignorehidden | If true don't return hidden events. |
callable | null | $filter | Additional logic to filter out unwanted events. Must return true to keep the event, false to discard it. |
event_interface[] | Array of event_interfaces. |
Implemented in core_calendar\local\event\data_access\event_vault.