Class containing the local calendar API.
More...
|
static | get_action_events_by_course ( $course, $timesortfrom=null, $timesortto=null, $aftereventid=null, $limitnum=20, ?string $searchvalue=null) |
| Get a list of action events for the logged in user by the given course and timesort values.
|
|
static | get_action_events_by_courses ( $courses=[], $timesortfrom=null, $timesortto=null, $limitnum=20, ?string $searchvalue=null) |
| Get a list of action events for the logged in user by the given courses and timesort values.
|
|
static | get_action_events_by_timesort ( $timesortfrom=null, $timesortto=null, $aftereventid=null, $limitnum=20, $limittononsuspendedevents=false, ?\stdClass $user=null, ?string $searchvalue=null) |
| Get a list of action events for the logged in user by the given timesort values.
|
|
static | get_events ( $timestartfrom=null, $timestartto=null, $timesortfrom=null, $timesortto=null, $timestartaftereventid=null, $timesortaftereventid=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.
|
|
static | update_event_start_day (event_interface $event, DateTimeInterface $startdate) |
| Change the start day for an event.
|
|
Class containing the local calendar API.
This should not be used outside of core_calendar.
- Copyright
- 2017 Ryan Wyllie ryan@.nosp@m.mood.nosp@m.le.co.nosp@m.m
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_action_events_by_course()
static core_calendar\local\api::get_action_events_by_course |
( |
| $course, |
|
|
| $timesortfrom = null, |
|
|
| $timesortto = null, |
|
|
| $aftereventid = null, |
|
|
| $limitnum = 20, |
|
|
?string | $searchvalue = null ) |
|
static |
Get a list of action events for the logged in user by the given course and timesort values.
- Parameters
-
stdClass | $course | The course the events must belong to |
int | null | $timesortfrom | The start timesort value (inclusive) |
int | null | $timesortto | The end timesort value (inclusive) |
int | null | $aftereventid | Only return events after this one |
int | $limitnum | Limit results to this amount (between 1 and 50) |
string | null | $searchvalue | The value a user wishes to search against |
- Return values
-
array | A list of action_event_interface objects |
- Exceptions
-
limit_invalid_parameter_exception | |
◆ get_action_events_by_courses()
static core_calendar\local\api::get_action_events_by_courses |
( |
| $courses = [], |
|
|
| $timesortfrom = null, |
|
|
| $timesortto = null, |
|
|
| $limitnum = 20, |
|
|
?string | $searchvalue = null ) |
|
static |
Get a list of action events for the logged in user by the given courses and timesort values.
The limit number applies per course, not for the result set as a whole. E.g. Requesting 3 courses with a limit of 10 will result in up to 30 events being returned (up to 10 per course).
- Parameters
-
array | $courses | The courses the events must belong to |
int | null | $timesortfrom | The start timesort value (inclusive) |
int | null | $timesortto | The end timesort value (inclusive) |
int | $limitnum | Limit results per course to this amount (between 1 and 50) |
string | null | $searchvalue | The value a user wishes to search against |
- Return values
-
array | A list of action_event_interface objects indexed by course id |
◆ get_action_events_by_timesort()
static core_calendar\local\api::get_action_events_by_timesort |
( |
| $timesortfrom = null, |
|
|
| $timesortto = null, |
|
|
| $aftereventid = null, |
|
|
| $limitnum = 20, |
|
|
| $limittononsuspendedevents = false, |
|
|
?\stdClass | $user = null, |
|
|
?string | $searchvalue = null ) |
|
static |
Get a list of action events for the logged in user by the given timesort values.
- Parameters
-
int | null | $timesortfrom | The start timesort value (inclusive) |
int | null | $timesortto | The end timesort value (inclusive) |
int | null | $aftereventid | Only return events after this one |
int | $limitnum | Limit results to this amount (between 1 and 50) |
bool | $lmittononsuspendedevents | Limit course events to courses the user is active in (not suspended). |
stdClass | null | $user | The user id or false for $USER |
string | null | $searchvalue | The value a user wishes to search against |
- Return values
-
array | A list of action_event_interface objects |
- Exceptions
-
◆ get_events()
static core_calendar\local\api::get_events |
( |
| $timestartfrom = null, |
|
|
| $timestartto = null, |
|
|
| $timesortfrom = null, |
|
|
| $timesortto = null, |
|
|
| $timestartaftereventid = null, |
|
|
| $timesortaftereventid = null, |
|
|
| $limitnum = 20, |
|
|
| $type = null, |
|
|
array | $usersfilter = null, |
|
|
array | $groupsfilter = null, |
|
|
array | $coursesfilter = null, |
|
|
array | $categoriesfilter = null, |
|
|
| $withduration = true, |
|
|
| $ignorehidden = true, |
|
|
callable | $filter = null ) |
|
static |
Get all events restricted by various parameters, taking in to account user and group overrides.
- Parameters
-
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). |
int | null | $timestartaftereventid | Restrict the events in the timestart range to ones after this ID. |
int | null | $timesortaftereventid | Restrict the events in the timesort range to ones after this ID. |
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. |
- Return values
-
core_calendar\local\event\entities\event_interface[] | Array of event_interfaces. |
◆ update_event_start_day()
static core_calendar\local\api::update_event_start_day |
( |
event_interface | $event, |
|
|
DateTimeInterface | $startdate ) |
|
static |
Change the start day for an event.
Only the date will be modified, the time of day for the event will be left as is.
- Parameters
-
event_interface | $event | The existing event to modify |
DateTimeInterface | $startdate | The new date to use for the start day |
- Return values
-
event_interface | The new event with updated start date |
The documentation for this class was generated from the following file:
- calendar/classes/local/api.php