delete related scheduled_task_subscribers records

This commit is contained in:
Amine Ben hammou
2018-09-19 16:55:32 +02:00
parent 5524805ec3
commit c51a3f208c
2 changed files with 29 additions and 0 deletions

View File

@ -76,6 +76,11 @@ class ScheduledTask extends Model {
return $this;
}
function delete() {
ScheduledTaskSubscriber::where('task_id', $this->id)->deleteMany();
return parent::delete();
}
static function touchAllByIds(array $ids) {
ScheduledTask::rawExecute(
'UPDATE `' . ScheduledTask::$_table . '`' .