|
Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
|
Public Member Functions | |
| config_form_definition (\MoodleQuickForm $mform) | |
| Add specific settings to the field configuration form, for example "default value". | |
| config_form_definition (MoodleQuickForm $mform) | |
| Add form elements for editing the custom field definition. | |
| config_form_validation (array $data, $files=[]) | |
| Validate the data on the field configuration form. | |
| course_grouping_format_values ($values) | |
| If this field supports course filtering, then this function needs overriding to return the formatted values for this. | |
| delete () | |
| Delete a field and all associated data. | |
| get (string $property) | |
| Persistent getter parser. | |
| get_category () | |
| Get the category associated with this field. | |
| get_configdata_property (string $property) | |
| Get configdata property. | |
| get_formatted_name (bool $escape=true) | |
| Returns the field name formatted according to configuration context. | |
| get_handler () | |
| Returns a handler for this field. | |
| is_editable () | |
| Can the value of this field be manually editable in the edit forms. | |
| parse_value (string $value) | |
| Perform pre-processing of field values, for example those that originate from an external source (e.g. | |
| prepare_field_for_display (mixed $value, ?context $context=null) | |
| Prepares a value for export. | |
| prepare_for_config_form (\stdClass $formdata) | |
| Prepare the field data to set in the configuration form. | |
| save () | |
| Save or update the persistent class to database. | |
| set ($property, $value) | |
| Persistent setter parser. | |
| supports_course_grouping () | |
| Does this custom field type support being used as part of the block_myoverview custom field grouping? | |
| to_record () | |
| Persistent to_record parser. | |
Static Public Member Functions | |
| static | create (int $id, ?\stdClass $record=null, ?category_controller $category=null) |
| Creates an instance of field_controller. | |
Protected Member Functions | |
| add_field_type_select (MoodleQuickForm $mform, array $providers) | |
| Adds selector to provider for field population. | |
Protected Attributes | |
| category_controller | $category |
| Category of the field. | |
| field | $field |
| Field persistent class. | |
|
protected |
Adds selector to provider for field population.
| MoodleQuickForm | $mform | |
| provider_base[] | $providers |
|
abstractinherited |
Add specific settings to the field configuration form, for example "default value".
| MoodleQuickForm | $mform |
Reimplemented in customfield_checkbox\field_controller, customfield_date\field_controller, customfield_select\field_controller, customfield_text\field_controller, and customfield_textarea\field_controller.
| customfield_number\field_controller::config_form_definition | ( | MoodleQuickForm | $mform | ) |
Add form elements for editing the custom field definition.
| MoodleQuickForm | $mform |
| customfield_number\field_controller::config_form_validation | ( | array | $data, |
| $files = [] ) |
Validate the data on the field configuration form.
| array | $data | |
| array | $files |
| array |
Reimplemented from core_customfield\field_controller.
|
inherited |
If this field supports course filtering, then this function needs overriding to return the formatted values for this.
| array | $values | the used values that need grouping |
| array |
Reimplemented in customfield_checkbox\field_controller, customfield_date\field_controller, customfield_select\field_controller, and customfield_text\field_controller.
|
staticinherited |
Creates an instance of field_controller.
Parameters $id, $record and $category can complement each other but not conflict. If $id is not specified, categoryid must be present either in $record or in $category. If $id is not specified, type must be present in $record
No DB queries are performed if both $record and $category are specified.
| int | $id | |
| stdClass | null | $record | |
| category_controller | null | $category |
| field_controller | will return the instance of the class from the customfield element plugin |
| coding_exception | |
| moodle_exception |
|
inherited |
Delete a field and all associated data.
Plugins may override it if it is necessary to delete related data (such as files)
Not that the delete() method from data_controller is not called here.
| bool |
Reimplemented in customfield_textarea\field_controller.
|
finalinherited |
Persistent getter parser.
| string | $property |
| mixed |
|
finalinherited |
Get the category associated with this field.
| category_controller |
|
inherited |
Get configdata property.
| string | $property | name of the property |
| mixed |
|
inherited |
Returns the field name formatted according to configuration context.
| bool | $escape |
| string |
|
finalinherited |
Returns a handler for this field.
| handler |
| customfield_number\field_controller::is_editable | ( | ) |
Can the value of this field be manually editable in the edit forms.
| bool |
|
inherited |
Perform pre-processing of field values, for example those that originate from an external source (e.g.
upload course tool)
Override in plugin classes as necessary
| string | $value |
| mixed |
Reimplemented in customfield_date\field_controller, and customfield_select\field_controller.
| customfield_number\field_controller::prepare_field_for_display | ( | mixed | $value, |
| ?context | $context = null ) |
Prepares a value for export.
| mixed | $value | |
| context | null | $context |
| string|float|null |
|
inherited |
Prepare the field data to set in the configuration form.
Plugin can override if some preprocessing required for editor or filemanager fields
| stdClass | $formdata |
Reimplemented in customfield_textarea\field_controller.
|
inherited |
Save or update the persistent class to database.
| void |
Reimplemented in customfield_textarea\field_controller.
|
finalinherited |
Persistent setter parser.
| string | $property | |
| mixed | $value |
| field |
|
inherited |
Does this custom field type support being used as part of the block_myoverview custom field grouping?
| bool |
Reimplemented in customfield_checkbox\field_controller, customfield_date\field_controller, customfield_select\field_controller, and customfield_text\field_controller.
|
finalinherited |
Persistent to_record parser.
| stdClass |