Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
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. | |
static | export_data_content ($context, $recordobj, $fieldobj, $contentobj, $defaultvalue) |
Exports data about one record in {data_content} table. | |
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_checkbox\privacy\provider, datafield_date\privacy\provider, datafield_file\privacy\provider, datafield_latlong\privacy\provider, datafield_menu\privacy\provider, datafield_multimenu\privacy\provider, datafield_number\privacy\provider, datafield_picture\privacy\provider, datafield_radiobutton\privacy\provider, datafield_text\privacy\provider, datafield_textarea\privacy\provider, and datafield_url\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_checkbox\privacy\provider, datafield_date\privacy\provider, datafield_file\privacy\provider, datafield_latlong\privacy\provider, datafield_menu\privacy\provider, datafield_multimenu\privacy\provider, datafield_number\privacy\provider, datafield_picture\privacy\provider, datafield_radiobutton\privacy\provider, datafield_text\privacy\provider, datafield_textarea\privacy\provider, and datafield_url\privacy\provider.