Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Interface datafield_provider, all datafield plugins need to implement it. More...
Static Public Member Functions | |
static | delete_data_content ($context, $recordobj, $fieldobj, $contentobj) |
Allows plugins to delete locally stored data. More... | |
static | export_data_content ($context, $recordobj, $fieldobj, $contentobj, $defaultvalue) |
Exports data about one record in {data_content} table. More... | |
Interface datafield_provider, all datafield plugins need to implement it.
|
static |
Allows plugins to delete locally stored data.
Usually datafield plugins do not store anything and this method will be empty.
context_module | $context | |
stdClass | $recordobj | record from DB table {data_records} |
stdClass | $fieldobj | record from DB table {data_fields} |
stdClass | $contentobj | record from DB table {data_content} |
Implemented in datafield_url\privacy\provider, datafield_textarea\privacy\provider, datafield_text\privacy\provider, datafield_radiobutton\privacy\provider, datafield_picture\privacy\provider, datafield_number\privacy\provider, datafield_multimenu\privacy\provider, datafield_menu\privacy\provider, datafield_latlong\privacy\provider, datafield_file\privacy\provider, datafield_date\privacy\provider, and datafield_checkbox\privacy\provider.
|
static |
Exports data about one record in {data_content} table.
Datafield plugins providers should implement this method to:
Sample implementation (from datafield_textarea):
$defaultvalue->content = writer::with_context($context) ->rewrite_pluginfile_urls([$recordobj->id, $contentobj->id], 'mod_data', 'content', $contentobj->id, $defaultvalue->content); writer::with_context($context)->export_data([$recordobj->id, $contentobj->id], $defaultvalue);
context_module | $context | |
stdClass | $recordobj | record from DB table {data_records} |
stdClass | $fieldobj | record from DB table {data_fields} |
stdClass | $contentobj | record from DB table {data_content} |
stdClass | $defaultvalue | pre-populated default value that most of plugins will use |
Implemented in datafield_url\privacy\provider, datafield_textarea\privacy\provider, datafield_text\privacy\provider, datafield_radiobutton\privacy\provider, datafield_picture\privacy\provider, datafield_number\privacy\provider, datafield_multimenu\privacy\provider, datafield_menu\privacy\provider, datafield_latlong\privacy\provider, datafield_file\privacy\provider, datafield_date\privacy\provider, and datafield_checkbox\privacy\provider.