Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_calendar\local\event\container Class Reference

Core container. More...

Static Public Member Functions

static apply_component_is_event_visible (event_interface $event)
 Calls callback 'core_calendar_is_event_visible' from the component responsible for the event.
 
static apply_component_provide_event_action (event_interface $event)
 Calls callback 'core_calendar_provide_event_action' from the component responsible for the event.
 
static get_event_factory ()
 Gets the event factory.
 
static get_event_mapper ()
 Gets the event mapper.
 
static get_event_vault ()
 Return an event vault.
 
static get_requesting_user ()
 Returns the requesting user id.
 
static reset_caches ()
 Reset all static caches, called between tests.
 
static set_requesting_user ($userid)
 Sets the requesting user so that all capability checks are done against this user.
 

Static Protected Attributes

static action_factory $actionfactory
 $actionfactory Action factory.
 
static stdClass[] $coursecache = array()
 An array of cached courses to use with the event factory.
 
static event_factory $eventfactory
 $eventfactory Event factory.
 
static event_mapper $eventmapper
 $eventmapper Event mapper.
 
static raw_event_retrieval_strategy $eventretrievalstrategy
 $eventretrievalstrategy Event retrieval strategy.
 
static event_vault $eventvault
 $eventvault Event vault.
 
static stdClass[] $modulecache = array()
 An array of cached modules to use with the event factory.
 
static int $requestinguserid
 The requesting user.
 

Detailed Description

Core container.

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

Member Function Documentation

◆ apply_component_is_event_visible()

static core_calendar\local\event\container::apply_component_is_event_visible ( event_interface $event)
static

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.

Parameters
event_interface$event
Return values
bool

◆ apply_component_provide_event_action()

static core_calendar\local\event\container::apply_component_provide_event_action ( event_interface $event)
static

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.

Parameters
event_interface$event
Return values
action_event|event_interface

◆ get_event_factory()

static core_calendar\local\event\container::get_event_factory ( )
static

Gets the event factory.

Return values
event_factory

◆ get_event_mapper()

static core_calendar\local\event\container::get_event_mapper ( )
static

Gets the event mapper.

Return values
event_mapper

◆ get_event_vault()

static core_calendar\local\event\container::get_event_vault ( )
static

Return an event vault.

Return values
event_vault

◆ get_requesting_user()

static core_calendar\local\event\container::get_requesting_user ( )
static

Returns the requesting user id.

It usually is the current user unless it has been set explicitly using set_requesting_user.

Return values
int

◆ set_requesting_user()

static core_calendar\local\event\container::set_requesting_user ( $userid)
static

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.

Parameters
int$useridThe user id.
Exceptions
coding_exception

Member Data Documentation

◆ $requestinguserid

int core_calendar\local\event\container::$requestinguserid
staticprotected

The requesting user.

All capability checks are done against this user.


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