See Release Notes
Long Term Support Release
Differences Between: [Versions 310 and 401] [Versions 39 and 401]
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 |
container:: (9 methods):
init()
reset_caches()
get_event_factory()
get_event_mapper()
get_event_vault()
set_requesting_user()
get_requesting_user()
apply_component_provide_event_action()
apply_component_is_event_visible()
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 |