MDL-59162 tool_models: Remove dependant models on uninstall

Part of MDL-57791 epic.
This commit is contained in:
David Monllao 2017-06-06 17:04:20 +02:00
parent 9ad87761ef
commit d16cf374eb
2 changed files with 55 additions and 0 deletions

View file

@ -316,6 +316,17 @@ class model {
$this->uniqueid = null;
}
/**
* Removes the model.
*
* @return void
*/
public static function delete() {
global $DB;
$this->clear_model();
$DB->delete_record('analytics_models', array('id' => $this->model->id));
}
/**
* Evaluates the model datasets.
*