From 53d85ae1346eca43ae4b872afe761abb8fd855cd Mon Sep 17 00:00:00 2001 From: rGaillard Date: Sun, 20 Nov 2011 17:13:36 +0000 Subject: [PATCH] // Shop association improvements git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10298 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/ObjectModel.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index 4765d9dc0..2f6b6a86b 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -366,6 +366,14 @@ abstract class ObjectModelCore if (method_exists($this, 'getTranslationsFieldsChild')) Db::getInstance()->execute('DELETE FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + $assos = Shop::getAssoTables(); + if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'shop') + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.$this->table.'_shop` WHERE `'.$this->identifier.'`='.(int)$this->id); + + $assos = GroupShop::getAssoTables(); + if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'group_shop') + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.$this->table.'group_shop` WHERE `'.$this->identifier.'`='.(int)$this->id); + /* Hook */ Hook::exec('actionObject'.get_class($this).'DeleteAfter');