Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | List of all members
core_calendar\local\event\data_access\event_vault_interface Interface Reference

Interface for an event vault class. More...

Inheritance diagram for core_calendar\local\event\data_access\event_vault_interface:
core_calendar\local\event\data_access\event_vault

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...
 

Detailed Description

Interface for an event vault class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_action_events_by_course()

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.

Parameters
stdClass$userThe user for whom the events belong
stdClass$courseThe course to filter by
int$timesortfromEvents with timesort from this value (inclusive)
int$timesorttoEvents with timesort until this value (inclusive)
event_interface$aftereventOnly return events after this one
int$limitnumReturn at most this number of events
Return values
action_event_interface

Implemented in core_calendar\local\event\data_access\event_vault.

◆ get_action_events_by_timesort()

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.

Parameters
stdClass$userThe user for whom the events belong
int$timesortfromEvents with timesort from this value (inclusive)
int$timesorttoEvents with timesort until this value (inclusive)
event_interface$aftereventOnly return events after this one
int$limitnumReturn at most this number of events
bool$lmittononsuspendedeventsLimit course events to courses the user is active in (not suspended).
Return values
event_interface

Implemented in core_calendar\local\event\data_access\event_vault.

◆ get_event_by_id()

core_calendar\local\event\data_access\event_vault_interface::get_event_by_id (   $id)

Retrieve an event for the given id.

Parameters
int$idThe event id
Return values
event_interface|false

Implemented in core_calendar\local\event\data_access\event_vault.

◆ get_events()

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.

Parameters
int | null$timestartfromEvents with timestart from this value (inclusive).
int | null$timestarttoEvents with timestart until this value (inclusive).
int | null$timesortfromEvents with timesort from this value (inclusive).
int | null$timesorttoEvents with timesort until this value (inclusive).
event_interface | null$timestartaftereventRestrict the events in the timestart range to ones after this one.
event_interface | null$timesortaftereventRestrict the events in the timesort range to ones after this one.
int$limitnumReturn at most this number of events.
int | null$typeReturn only events of this type.
array | null$usersfilterReturn only events for these users.
array | null$groupsfilterReturn only events for these groups.
array | null$coursesfilterReturn only events for these courses.
bool$withdurationIf true return only events starting within specified timestart otherwise return in progress events as well.
bool$ignorehiddenIf true don't return hidden events.
callable | null$filterAdditional logic to filter out unwanted events. Must return true to keep the event, false to discard it.
Return values
event_interface[]Array of event_interfaces.

Implemented in core_calendar\local\event\data_access\event_vault.


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