Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_calendar_external Class Reference

Calendar external functions. More...

Inheritance diagram for core_calendar_external:

Static Public Member Functions

static create_calendar_events ($events)
 Create calendar events.
 
static create_calendar_events_parameters ()
 Returns description of method parameters.
 
static create_calendar_events_returns ()
 Returns description of method result value.
 
static delete_calendar_events ($events)
 Delete Calendar events.
 
static delete_calendar_events_parameters ()
 Returns description of method parameters.
 
static delete_calendar_events_returns ()
 Returns description of method result value.
 
static get_allowed_event_types ($courseid=0)
 Get the type of events a user can create in the given course.
 
static get_allowed_event_types_parameters ()
 Returns description of method parameters.
 
static get_allowed_event_types_returns ()
 Returns description of method result value.
 
static get_calendar_access_information ($courseid=0)
 Convenience function to retrieve some permissions information for the given course calendar.
 
static get_calendar_access_information_parameters ()
 Returns description of method parameters.
 
static get_calendar_access_information_returns ()
 Returns description of method result value.
 
static get_calendar_action_events_by_course ( $courseid, $timesortfrom=null, $timesortto=null, $aftereventid=0, $limitnum=20, ?string $searchvalue=null)
 Get calendar action events for the given course.
 
static get_calendar_action_events_by_course_parameters ()
 Returns description of method parameters.
 
static get_calendar_action_events_by_course_returns ()
 Returns description of method result value.
 
static get_calendar_action_events_by_courses (array $courseids, $timesortfrom=null, $timesortto=null, $limitnum=10, ?string $searchvalue=null)
 Get calendar action events for a given list of courses.
 
static get_calendar_action_events_by_courses_parameters ()
 Returns description of method parameters.
 
static get_calendar_action_events_by_courses_returns ()
 Returns description of method result value.
 
static get_calendar_action_events_by_timesort ($timesortfrom=0, $timesortto=null, $aftereventid=0, $limitnum=20, $limittononsuspendedevents=false, $userid=null, ?string $searchvalue=null)
 Get calendar action events based on the timesort value.
 
static get_calendar_action_events_by_timesort_parameters ()
 Returns description of method parameters.
 
static get_calendar_action_events_by_timesort_returns ()
 Returns description of method result value.
 
static get_calendar_day_view ($year, $month, $day, $courseid, $categoryid)
 Get data for the daily calendar view.
 
static get_calendar_day_view_parameters ()
 Returns description of method parameters.
 
static get_calendar_day_view_returns ()
 Returns description of method result value.
 
static get_calendar_event_by_id ($eventid)
 Get calendar event by id.
 
static get_calendar_event_by_id_parameters ()
 Returns description of method parameters.
 
static get_calendar_event_by_id_returns ()
 Returns description of method result value.
 
static get_calendar_events ($events=array(), $options=array())
 Get Calendar events.
 
static get_calendar_events_parameters ()
 Returns description of method parameters.
 
static get_calendar_events_returns ()
 Returns description of method result value.
 
static get_calendar_monthly_view ($year, $month, $courseid, $categoryid, $includenavigation, $mini, $day, ?string $view=null)
 Get data for the monthly calendar view.
 
static get_calendar_monthly_view_parameters ()
 Returns description of method parameters.
 
static get_calendar_monthly_view_returns ()
 Returns description of method result value.
 
static get_calendar_upcoming_view ($courseid, $categoryid)
 Get data for the monthly calendar view.
 
static get_calendar_upcoming_view_parameters ()
 Returns description of method parameters.
 
static get_calendar_upcoming_view_returns ()
 Returns description of method result value.
 
static get_timestamps ($datetimes)
 Convert the specified dates into unix timestamps.
 
static get_timestamps_parameters ()
 Describes the parameters for get_timestamps.
 
static get_timestamps_returns ()
 Describes the timestamps return format.
 
static submit_create_update_form ($formdata)
 Handles the event form submission.
 
static submit_create_update_form_parameters ()
 Returns description of method parameters.
 
static submit_create_update_form_returns ()
 Returns description of method result value.
 
static update_event_start_day ($eventid, $daytimestamp)
 Change the start day for the given calendar event to the day that corresponds with the provided timestamp.
 
static update_event_start_day_parameters ()
 Returns description of method parameters.
 
static update_event_start_day_returns ()
 Returns description of method result value.
 

Detailed Description

Calendar external functions.

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

Member Function Documentation

◆ create_calendar_events()

static core_calendar_external::create_calendar_events ( $events)
static

Create calendar events.

Parameters
array$eventsA list of events to create.
Return values
arrayarray of events created.
Since
Moodle 2.5
Exceptions
moodle_exceptionif user doesnt have the permission to create events.

◆ create_calendar_events_parameters()

static core_calendar_external::create_calendar_events_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters.
Since
Moodle 2.5

◆ create_calendar_events_returns()

static core_calendar_external::create_calendar_events_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description.
Since
Moodle 2.5

◆ delete_calendar_events()

static core_calendar_external::delete_calendar_events ( $events)
static

Delete Calendar events.

Parameters
array$eventidsA list of event ids with repeat flag to delete
Return values
null
Since
Moodle 2.5

◆ delete_calendar_events_parameters()

static core_calendar_external::delete_calendar_events_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.5

◆ delete_calendar_events_returns()

static core_calendar_external::delete_calendar_events_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.5

◆ get_allowed_event_types()

static core_calendar_external::get_allowed_event_types ( $courseid = 0)
static

Get the type of events a user can create in the given course.

Parameters
int$courseidCourse to check, empty for site.
Return values
arrayThe types allowed
Exceptions
moodle_exception
Since
Moodle 3.7

◆ get_allowed_event_types_parameters()

static core_calendar_external::get_allowed_event_types_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters.
Since
Moodle 3.7

◆ get_allowed_event_types_returns()

static core_calendar_external::get_allowed_event_types_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description.
Since
Moodle 3.7

◆ get_calendar_access_information()

static core_calendar_external::get_calendar_access_information ( $courseid = 0)
static

Convenience function to retrieve some permissions information for the given course calendar.

Parameters
int$courseidCourse to check, empty for site.
Return values
arrayThe access information
Exceptions
moodle_exception
Since
Moodle 3.7

◆ get_calendar_access_information_parameters()

static core_calendar_external::get_calendar_access_information_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters.
Since
Moodle 3.7

◆ get_calendar_access_information_returns()

static core_calendar_external::get_calendar_access_information_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description.
Since
Moodle 3.7

◆ get_calendar_action_events_by_course()

static core_calendar_external::get_calendar_action_events_by_course ( $courseid,
$timesortfrom = null,
$timesortto = null,
$aftereventid = 0,
$limitnum = 20,
?string $searchvalue = null )
static

Get calendar action events for the given course.

Since
Moodle 3.3
Parameters
int$courseidOnly events in this course
null | int$timesortfromEvents after this time (inclusive)
null | int$timesorttoEvents before this time (inclusive)
null | int$aftereventidGet events with ids greater than this one
int$limitnumLimit the number of results to this value
string | null$searchvalueThe value a user wishes to search against
Return values
array

◆ get_calendar_action_events_by_course_parameters()

static core_calendar_external::get_calendar_action_events_by_course_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_calendar_action_events_by_course_returns()

static core_calendar_external::get_calendar_action_events_by_course_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_calendar_action_events_by_courses()

static core_calendar_external::get_calendar_action_events_by_courses ( array $courseids,
$timesortfrom = null,
$timesortto = null,
$limitnum = 10,
?string $searchvalue = null )
static

Get calendar action events for a given list of courses.

Since
Moodle 3.3
Parameters
array$courseidsOnly include events for these courses
null | int$timesortfromEvents after this time (inclusive)
null | int$timesorttoEvents before this time (inclusive)
int$limitnumLimit the number of results per course to this value
string | null$searchvalueThe value a user wishes to search against
Return values
array

◆ get_calendar_action_events_by_courses_parameters()

static core_calendar_external::get_calendar_action_events_by_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_calendar_action_events_by_courses_returns()

static core_calendar_external::get_calendar_action_events_by_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_calendar_action_events_by_timesort()

static core_calendar_external::get_calendar_action_events_by_timesort ( $timesortfrom = 0,
$timesortto = null,
$aftereventid = 0,
$limitnum = 20,
$limittononsuspendedevents = false,
$userid = null,
?string $searchvalue = null )
static

Get calendar action events based on the timesort value.

Since
Moodle 3.3
Parameters
null | int$timesortfromEvents after this time (inclusive)
null | int$timesorttoEvents before this time (inclusive)
null | int$aftereventidGet events with ids greater than this one
int$limitnumLimit the number of results to this value
null | int$useridThe user id
string | null$searchvalueThe value a user wishes to search against
Return values
array

◆ get_calendar_action_events_by_timesort_parameters()

static core_calendar_external::get_calendar_action_events_by_timesort_parameters ( )
static

Returns description of method parameters.

Since
Moodle 3.3
Return values
external_function_parameters

◆ get_calendar_action_events_by_timesort_returns()

static core_calendar_external::get_calendar_action_events_by_timesort_returns ( )
static

Returns description of method result value.

Since
Moodle 3.3
Return values
core_external\external_description

◆ get_calendar_day_view()

static core_calendar_external::get_calendar_day_view ( $year,
$month,
$day,
$courseid,
$categoryid )
static

Get data for the daily calendar view.

Parameters
int$yearThe year to be shown
int$monthThe month to be shown
int$dayThe day to be shown
int$courseidThe course to be included
Return values
array

◆ get_calendar_day_view_parameters()

static core_calendar_external::get_calendar_day_view_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_calendar_day_view_returns()

static core_calendar_external::get_calendar_day_view_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_calendar_event_by_id()

static core_calendar_external::get_calendar_event_by_id ( $eventid)
static

Get calendar event by id.

Parameters
int$eventidThe calendar event id to be retrieved.
Return values
arrayArray of event details

◆ get_calendar_event_by_id_parameters()

static core_calendar_external::get_calendar_event_by_id_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_calendar_event_by_id_returns()

static core_calendar_external::get_calendar_event_by_id_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_calendar_events()

static core_calendar_external::get_calendar_events ( $events = array(),
$options = array() )
static

Get Calendar events.

Parameters
array$eventsA list of events
array$optionsvarious options
Return values
arrayArray of event details
Since
Moodle 2.5

◆ get_calendar_events_parameters()

static core_calendar_external::get_calendar_events_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.5

◆ get_calendar_events_returns()

static core_calendar_external::get_calendar_events_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.5

◆ get_calendar_monthly_view()

static core_calendar_external::get_calendar_monthly_view ( $year,
$month,
$courseid,
$categoryid,
$includenavigation,
$mini,
$day,
?string $view = null )
static

Get data for the monthly calendar view.

Parameters
int$yearThe year to be shown
int$monthThe month to be shown
int$courseidThe course to be included
int$categoryidThe category to be included
bool$includenavigationWhether to include navigation
bool$miniWhether to return the mini month view or not
int$dayThe day we want to keep as the current day
string | null$viewThe view mode for the calendar.
Return values
array

◆ get_calendar_monthly_view_parameters()

static core_calendar_external::get_calendar_monthly_view_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_calendar_monthly_view_returns()

static core_calendar_external::get_calendar_monthly_view_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_calendar_upcoming_view()

static core_calendar_external::get_calendar_upcoming_view ( $courseid,
$categoryid )
static

Get data for the monthly calendar view.

Parameters
int$courseidThe course to be included
int$categoryidThe category to be included
Return values
array

◆ get_calendar_upcoming_view_parameters()

static core_calendar_external::get_calendar_upcoming_view_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_calendar_upcoming_view_returns()

static core_calendar_external::get_calendar_upcoming_view_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_timestamps()

static core_calendar_external::get_timestamps ( $datetimes)
static

Convert the specified dates into unix timestamps.

Parameters
array$datetimesArray of arrays containing date time details, each in the format: ['year' => a, 'month' => b, 'day' => c, 'hour' => d (optional), 'minute' => e (optional), 'key' => 'x' (optional)]
Return values
arrayProvided array of dates converted to unix timestamps
Exceptions
moodle_exceptionIf one or more of the dates provided does not convert to a valid timestamp.

◆ get_timestamps_parameters()

static core_calendar_external::get_timestamps_parameters ( )
static

Describes the parameters for get_timestamps.

Return values
external_function_parameters

◆ get_timestamps_returns()

static core_calendar_external::get_timestamps_returns ( )
static

Describes the timestamps return format.

Return values
external_single_structure

◆ submit_create_update_form()

static core_calendar_external::submit_create_update_form ( $formdata)
static

Handles the event form submission.

Parameters
string$formdataThe event form data in a URI encoded param string
Return values
arrayThe created or modified event
Exceptions
moodle_exception

◆ submit_create_update_form_parameters()

static core_calendar_external::submit_create_update_form_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters.

◆ submit_create_update_form_returns()

static core_calendar_external::submit_create_update_form_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description.

◆ update_event_start_day()

static core_calendar_external::update_event_start_day ( $eventid,
$daytimestamp )
static

Change the start day for the given calendar event to the day that corresponds with the provided timestamp.

The timestamp only needs to be anytime within the desired day as only the date data is extracted from it.

The event's original time of day is maintained, only the date is shifted.

Parameters
int$eventidId of event to be updated
int$daytimestampTimestamp for the new start day
Return values
array

◆ update_event_start_day_parameters()

static core_calendar_external::update_event_start_day_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ update_event_start_day_returns()

static core_calendar_external::update_event_start_day_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

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