MDL-40061 mod_data: replaced 'fields update' add_to_log call with an event

This commit is contained in:
Mark Nelson
2014-02-14 18:12:41 -08:00
parent e0d7ed6dae
commit d1ec55570d
5 changed files with 144 additions and 3 deletions
+12
View File
@@ -214,6 +214,18 @@ class data_field_base { // Base class for Database Field Types (see field/*/
global $DB;
$DB->update_record('data_fields', $this->field);
// Trigger an event for updating this field.
$event = \mod_data\event\field_updated::create(array(
'objectid' => $this->field->id,
'context' => $this->context,
'other' => array(
'fieldname' => $this->field->name,
'dataid' => $this->data->id
)
));
$event->trigger();
return true;
}