Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
customfield_number\local\numberproviders\nofactivities Class Reference
Inheritance diagram for customfield_number\local\numberproviders\nofactivities:
customfield_number\provider_base

Public Member Functions

 config_form_definition (MoodleQuickForm $mform)
 Add autocomplete field for selecting activity type.
 
 config_form_validation (array $data, array $files=[])
 Validate the data on the field configuration form for number of activities provider.
 
 get_default_value ()
 Default value if there is no value in the database (or there is a null)
 
 get_name ()
 Provider name.
 
 is_available ()
 Check if the provider is available for the current field.
 
 prepare_export_value (mixed $value, ?\context $context=null)
 Preparation for export for number of activities provider.
 
 recalculate (?int $instanceid=null)
 Recalculate the number of activities in the course.
 

Static Public Member Functions

static get_all_providers (field_controller $field)
 List of applicable automatic providers for this field.
 
static instance (\core_customfield\field_controller $field)
 Returns a new provider instance.
 

Member Function Documentation

◆ config_form_definition()

customfield_number\local\numberproviders\nofactivities::config_form_definition ( MoodleQuickForm $mform)

Add autocomplete field for selecting activity type.

Also add checkbox to display the field when the number of activities is zero.

Parameters
MoodleQuickForm$mform

Reimplemented from customfield_number\provider_base.

◆ config_form_validation()

customfield_number\local\numberproviders\nofactivities::config_form_validation ( array $data,
array $files = [] )

Validate the data on the field configuration form for number of activities provider.

Parameters
array$data
array$files
Return values
arrayassociative array of error messages

Reimplemented from customfield_number\provider_base.

◆ get_all_providers()

static customfield_number\provider_base::get_all_providers ( field_controller $field)
staticfinalinherited

List of applicable automatic providers for this field.

Parameters
field_controller$field
Return values
provider_base[]

◆ get_default_value()

customfield_number\provider_base::get_default_value ( )
inherited

Default value if there is no value in the database (or there is a null)

Usually returns either null or 0

Return values
null|float

◆ get_name()

customfield_number\local\numberproviders\nofactivities::get_name ( )

Provider name.

Reimplemented from customfield_number\provider_base.

◆ instance()

static customfield_number\provider_base::instance ( \core_customfield\field_controller $field)
staticfinalinherited

Returns a new provider instance.

Parameters
field_controller$fieldField

◆ is_available()

customfield_number\local\numberproviders\nofactivities::is_available ( )

Check if the provider is available for the current field.

Return values
bool

Reimplemented from customfield_number\provider_base.

◆ prepare_export_value()

customfield_number\local\numberproviders\nofactivities::prepare_export_value ( mixed $value,
?\context $context = null )

Preparation for export for number of activities provider.

Parameters
mixed$valueString or float or null if the value is not present in the database for this instance
context | null$contextContext
Return values
?string

Reimplemented from customfield_number\provider_base.

◆ recalculate()

customfield_number\local\numberproviders\nofactivities::recalculate ( ?int $instanceid = null)

Recalculate the number of activities in the course.

Parameters
int | null$instanceid

Reimplemented from customfield_number\provider_base.


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