Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
customfield_number\observer Class Reference

Static Public Member Functions

static course_module_created (\core\event\course_module_created $event)
 When a course module was created, schedule recalculation for all 'nofactivities' custom fields.
 
static course_module_deleted (\core\event\course_module_deleted $event)
 When a course module was deleted, schedule recalculation for all 'nofactivities' custom fields.
 
static course_module_updated (\core\event\course_module_updated $event)
 When a course module was updated, schedule recalculation for all 'nofactivities' custom fields.
 
static field_created (\core_customfield\event\field_created $event)
 When a 'number' custom field was created, schedule recalculation for the field data.
 
static field_updated (\core_customfield\event\field_updated $event)
 When a 'number' custom field was updated, schedule recalculation for the field data.
 

Static Protected Member Functions

static has_nofactivities_fields ()
 Checks if a 'number' field with 'nofactivities' provider exists in the course fields.
 

Member Function Documentation

◆ course_module_created()

static customfield_number\observer::course_module_created ( \core\event\course_module_created $event)
static

When a course module was created, schedule recalculation for all 'nofactivities' custom fields.

Parameters
core::event::course_module_created$event

◆ course_module_deleted()

static customfield_number\observer::course_module_deleted ( \core\event\course_module_deleted $event)
static

When a course module was deleted, schedule recalculation for all 'nofactivities' custom fields.

Parameters
core\event\course_module_deleted$event

◆ course_module_updated()

static customfield_number\observer::course_module_updated ( \core\event\course_module_updated $event)
static

When a course module was updated, schedule recalculation for all 'nofactivities' custom fields.

Module visibility may change following an 'updated' event and it will affect the activities count

Parameters
core::event::course_module_updated$event

◆ field_created()

static customfield_number\observer::field_created ( \core_customfield\event\field_created $event)
static

When a 'number' custom field was created, schedule recalculation for the field data.

Parameters
core_customfield\event\field_created$event

◆ field_updated()

static customfield_number\observer::field_updated ( \core_customfield\event\field_updated $event)
static

When a 'number' custom field was updated, schedule recalculation for the field data.

Parameters
core_customfield\event\field_updated$event

◆ has_nofactivities_fields()

static customfield_number\observer::has_nofactivities_fields ( )
staticprotected

Checks if a 'number' field with 'nofactivities' provider exists in the course fields.

This method is very fast, it only performs one DB query and only once per request

Return values
bool

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