Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

Core container for calendar events. The purpose of this class is simply to wire together the various implementations of calendar event components to produce a solution to the problems Moodle core wants to solve.

Copyright: 2017 Cameron Ball <cameron@cameron1729.xyz>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 361 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: container  - X-Ref

Core container.

init()   X-Ref
Initialises the dependency graph if it hasn't yet been.


reset_caches()   X-Ref
No description

get_event_factory()   X-Ref
Gets the event factory.

return: event_factory

get_event_mapper()   X-Ref
Gets the event mapper.

return: event_mapper

get_event_vault()   X-Ref
Return an event vault.

return: event_vault

set_requesting_user($userid)   X-Ref
Sets the requesting user so that all capability checks are done against this user.
Setting the requesting user (hence calling this function) is optional and if you do not so,
$USER will be used as the requesting user. However, if you wish to set the requesting user yourself,
you should call this function before any other function of the container class is called.

param: int $userid The user id.

get_requesting_user()   X-Ref
Returns the requesting user id.
It usually is the current user unless it has been set explicitly using set_requesting_user.

return: int

apply_component_provide_event_action(event_interface $event)   X-Ref
Calls callback 'core_calendar_provide_event_action' from the component responsible for the event

If no callback is present or callback returns null, there is no action on the event
and it will not be displayed on the dashboard.

param: event_interface $event
return: action_event|event_interface

apply_component_is_event_visible(event_interface $event)   X-Ref
Calls callback 'core_calendar_is_event_visible' from the component responsible for the event

The visibility callback is optional, if not present it is assumed as visible.
If it is an actionable event but the get_item_count() returns 0 the visibility
is set to false.

param: event_interface $event
return: bool