Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Contains interface customfield_provider

Copyright: 2018 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 84 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

customfield_provider:: (3 methods):
  export_customfield_data()
  before_delete_data()
  before_delete_fields()


Interface: customfield_provider  - X-Ref

Interface customfield_provider, all customfield plugins need to implement it

export_customfield_data(data_controller $data, \stdClass $exportdata, array $subcontext)   X-Ref
Preprocesses data object that is going to be exported

Minimum implementation:
writer::with_context($data->get_context())->export_data($subcontext, $exportdata);

param: data_controller $data
param: \stdClass $exportdata generated object to be exported
param: array $subcontext subcontext to use when exporting
return: mixed

before_delete_data(string $dataidstest, array $params, array $contextids)   X-Ref
Allows plugins to delete everything they store related to the data (usually files)

If plugin does not store any related files or other information, implement as an empty function

param: string $dataidstest select query for data id (note that it may also return data for other field types)
param: array $params named parameters for the select query
param: array $contextids list of affected data contexts
return: mixed

before_delete_fields(string $fieldidstest, array $params, array $contextids)   X-Ref
Allows plugins to delete everything they store related to the field configuration (usually files)

The implementation should not delete data or anything related to the data, since "before_delete_data" is
invoked separately.

If plugin does not store any related files or other information, implement as an empty function

param: string $fieldidstest select query for field id (note that it may also return fields of other types)
param: array $params named parameters for the select query
param: int[] $contextids list of affected configuration contexts