Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 186 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: grouping_handler  - X-Ref

Grouping handler for custom fields.

create(int $itemid = 0)   X-Ref
Returns a singleton.

param: int $itemid
return: \core_customfield\handler

reset_caches()   X-Ref
Run reset code after unit tests to reset the singleton usage.


can_configure()   X-Ref
The current user can configure custom fields on this component.

return: bool true if the current can configure custom fields, false otherwise

can_edit(field_controller $field, int $instanceid = 0)   X-Ref
The current user can edit custom fields on the given group.

param: field_controller $field
param: int $instanceid id of the group to test edit permission
return: bool true if the current can edit custom field, false otherwise

can_view(field_controller $field, int $instanceid)   X-Ref
The current user can view custom fields on the given group.

param: field_controller $field
param: int $instanceid id of the group to test edit permission
return: bool true if the current can view custom field, false otherwise

get_configuration_context()   X-Ref
Context that should be used for new categories created by this handler.

return: context the context for configuration

get_configuration_url()   X-Ref
URL for configuration of the fields on this handler.

return: moodle_url The URL to configure custom fields for this component

get_instance_context(int $instanceid = 0)   X-Ref
Returns the context for the data associated with the given instanceid.

param: int $instanceid id of the record to get the context for
return: context the context for the given record

get_instance_data_for_backup(int $instanceid)   X-Ref
Get raw data associated with all fields current user can view or edit

param: int $instanceid
return: array

restore_instance_data_from_backup(restore_task $task, array $data)   X-Ref
Creates or updates custom field data for a instanceid from backup data.

The handlers have to override it if they support backup

param: restore_task $task
param: array $data