Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
customfield_select\field_controller Class Reference
Inheritance diagram for customfield_select\field_controller:
core_customfield\field_controller

Public Member Functions

 config_form_definition (\MoodleQuickForm $mform)
 Add fields for editing a select field.
 
 config_form_validation (array $data, $files=array())
 Validate the data from the config form.
 
 course_grouping_format_values ($values)
 If this field supports course grouping, 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 ()
 Returns the field name formatted according to configuration context.
 
 get_handler ()
 Returns a handler for this field.
 
 get_options ()
 Return configured field options.
 
 parse_value (string $value)
 Locate the value parameter in the field options array, and return it's index.
 
 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.
 
static get_options_array ()
 

Public Attributes

const TYPE = 'select'
 Customfield type.
 

Protected Attributes

category_controller $category
 Category of the field.
 
field $field
 Field persistent class.
 

Member Function Documentation

◆ config_form_definition()

customfield_select\field_controller::config_form_definition ( \MoodleQuickForm $mform)

Add fields for editing a select field.

Parameters
MoodleQuickForm$mform

Reimplemented from core_customfield\field_controller.

◆ config_form_validation()

customfield_select\field_controller::config_form_validation ( array $data,
$files = array() )

Validate the data from the config form.

Sub classes must reimplement it.

Parameters
array$datafrom the add/edit profile field form
array$files
Return values
arrayassociative array of error messages

Reimplemented from core_customfield\field_controller.

◆ course_grouping_format_values()

customfield_select\field_controller::course_grouping_format_values ( $values)

If this field supports course grouping, then this function needs overriding to return the formatted values for this.

Parameters
array$valuesthe used values that need formatting
Return values
array

Reimplemented from core_customfield\field_controller.

◆ create()

static core_customfield\field_controller::create ( int $id,
stdClass $record = null,
category_controller $category = null )
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.

Parameters
int$id
stdClass | null$record
category_controller | null$category
Return values
field_controllerwill return the instance of the class from the customfield element plugin
Exceptions
coding_exception
moodle_exception

◆ delete()

core_customfield\field_controller::delete ( )
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.

Return values
bool

Reimplemented in customfield_textarea\field_controller.

◆ get()

core_customfield\field_controller::get ( string $property)
finalinherited

Persistent getter parser.

Parameters
string$property
Return values
mixed

◆ get_category()

core_customfield\field_controller::get_category ( )
finalinherited

Get the category associated with this field.

Return values
category_controller

◆ get_configdata_property()

core_customfield\field_controller::get_configdata_property ( string $property)
inherited

Get configdata property.

Parameters
string$propertyname of the property
Return values
mixed

◆ get_formatted_name()

core_customfield\field_controller::get_formatted_name ( )
inherited

Returns the field name formatted according to configuration context.

Return values
string

◆ get_handler()

core_customfield\field_controller::get_handler ( )
finalinherited

Returns a handler for this field.

Return values
handler

◆ get_options()

customfield_select\field_controller::get_options ( )

Return configured field options.

Return values
array

◆ get_options_array()

static customfield_select\field_controller::get_options_array ( )
static
Deprecated
since Moodle 3.10 - MDL-68569 please use $field->get_options

◆ parse_value()

customfield_select\field_controller::parse_value ( string $value)

Locate the value parameter in the field options array, and return it's index.

Parameters
string$value
Return values
int

Reimplemented from core_customfield\field_controller.

◆ prepare_for_config_form()

core_customfield\field_controller::prepare_for_config_form ( \stdClass $formdata)
inherited

Prepare the field data to set in the configuration form.

Plugin can override if some preprocessing required for editor or filemanager fields

Parameters
stdClass$formdata

Reimplemented in customfield_textarea\field_controller.

◆ save()

core_customfield\field_controller::save ( )
inherited

Save or update the persistent class to database.

Return values
void

Reimplemented in customfield_textarea\field_controller.

◆ set()

core_customfield\field_controller::set ( $property,
$value )
finalinherited

Persistent setter parser.

Parameters
string$property
mixed$value
Return values
field

◆ supports_course_grouping()

customfield_select\field_controller::supports_course_grouping ( )

Does this custom field type support being used as part of the block_myoverview custom field grouping?

Return values
bool

Reimplemented from core_customfield\field_controller.

◆ to_record()

core_customfield\field_controller::to_record ( )
finalinherited

Persistent to_record parser.

Return values
stdClass

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