Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | Static Protected Attributes | List of all members
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. More...
 
static apply_component_provide_event_action (event_interface $event)
 Calls callback 'core_calendar_provide_event_action' from the component responsible for the event. More...
 
static get_event_factory ()
 Gets the event factory. More...
 
static get_event_mapper ()
 Gets the event mapper. More...
 
static get_event_vault ()
 Return an event vault. More...
 
static get_requesting_user ()
 Returns the requesting user id. More...
 
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. More...
 

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. More...
 

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: