From ed47052a59051313a77a87594dc2c4851c969515 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Wed, 22 May 2019 16:18:09 +0200 Subject: [PATCH] Added functionality to allow to remove slave objects in database in case of deletion --- src/admin/common/abstract/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/admin/common/abstract/model.php b/src/admin/common/abstract/model.php index 41829ef..2d891d0 100644 --- a/src/admin/common/abstract/model.php +++ b/src/admin/common/abstract/model.php @@ -310,7 +310,9 @@ abstract class AbstractCommonClubsModel $q->where("id = {$this->id}"); } - // FIXME Add additional filter to remove associations of the object + protected function prepareDelete() + {} + public function delete() { $db = Factory::getDbo(); @@ -322,6 +324,7 @@ abstract class AbstractCommonClubsModel $q->where("id = {$this->id}"); $db->transactionStart(); + $this->prepareDelete(); $db->setQuery($q); $db->execute(); $db->transactionCommit();