Base class for custom fields controllers.
More...
Base class for custom fields controllers.
This class is a wrapper around the persistent field class that allows to define the field configuration
Custom field plugins must define a class {pluginname}::field_controller extends core_customfield\field_controller
- Copyright
- 2018 Toni Barbera toni@.nosp@m.mood.nosp@m.le.co.nosp@m.m
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_customfield\field_controller::__construct |
( |
int |
$id = 0 , |
|
|
stdClass |
$record = null |
|
) |
| |
Constructor.
- Parameters
-
int | $id | |
stdClass | null | $record | |
◆ config_form_definition()
core_customfield\field_controller::config_form_definition |
( |
\MoodleQuickForm |
$mform | ) |
|
|
abstract |
◆ config_form_validation()
core_customfield\field_controller::config_form_validation |
( |
array |
$data, |
|
|
|
$files = array() |
|
) |
| |
◆ course_grouping_format_values()
core_customfield\field_controller::course_grouping_format_values |
( |
|
$values | ) |
|
◆ create()
static core_customfield\field_controller::create |
( |
int |
$id, |
|
|
stdClass |
$record = null , |
|
|
category_controller |
$category = null |
|
) |
| |
|
static |
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
-
- Return values
-
field_controller | will return the instance of the class from the customfield element plugin |
- Exceptions
-
◆ delete()
core_customfield\field_controller::delete |
( |
| ) |
|
◆ get()
core_customfield\field_controller::get |
( |
string |
$property | ) |
|
|
final |
Persistent getter parser.
- Parameters
-
- Return values
-
◆ get_category()
core_customfield\field_controller::get_category |
( |
| ) |
|
|
final |
Get the category associated with this field.
- Return values
-
◆ get_configdata_property()
core_customfield\field_controller::get_configdata_property |
( |
string |
$property | ) |
|
Get configdata property.
- Parameters
-
string | $property | name of the property |
- Return values
-
◆ get_formatted_name()
core_customfield\field_controller::get_formatted_name |
( |
| ) |
|
Returns the field name formatted according to configuration context.
- Return values
-
◆ get_handler()
core_customfield\field_controller::get_handler |
( |
| ) |
|
|
final |
Returns a handler for this field.
- Return values
-
◆ parse_value()
core_customfield\field_controller::parse_value |
( |
string |
$value | ) |
|
◆ prepare_for_config_form()
core_customfield\field_controller::prepare_for_config_form |
( |
\stdClass |
$formdata | ) |
|
Prepare the field data to set in the configuration form.
Plugin can override if some preprocessing required for editor or filemanager fields
- Parameters
-
Reimplemented in customfield_textarea\field_controller.
◆ save()
core_customfield\field_controller::save |
( |
| ) |
|
◆ set()
core_customfield\field_controller::set |
( |
|
$property, |
|
|
|
$value |
|
) |
| |
|
final |
Persistent setter parser.
- Parameters
-
string | $property | |
mixed | $value | |
- Return values
-
◆ supports_course_grouping()
core_customfield\field_controller::supports_course_grouping |
( |
| ) |
|
◆ to_record()
core_customfield\field_controller::to_record |
( |
| ) |
|
|
final |
Persistent to_record parser.
- Return values
-
The documentation for this class was generated from the following file: