MDL-76715 mod_data: Remove data_records when the last field is deleted
This commit is contained in:
@@ -209,6 +209,17 @@ class manager {
|
||||
$event->trigger();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if the database has records.
|
||||
*
|
||||
* @return bool true if the database has records
|
||||
*/
|
||||
public function has_records(): bool {
|
||||
global $DB;
|
||||
|
||||
return $DB->record_exists('data_records', ['dataid' => $this->instance->id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if the database has fields.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user