// fixed bug #PSTEST-552

// Clean code

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13312 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete
2012-02-14 15:08:40 +00:00
parent 605fb24471
commit 3f5d7edf0b
3 changed files with 121 additions and 78 deletions

View File

@@ -2310,11 +2310,14 @@ class AdminControllerCore extends Controller
if (!$type)
return;
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.$this->table.'_'.$type.($id_object ? ' WHERE `'.$this->identifier.'`='.(int)$id_object : ''));
Db::getInstance()->execute('
DELETE FROM '._DB_PREFIX_.$this->table.'_'.$type.($id_object ? '
WHERE `'.$this->identifier.'`='.(int)$id_object : ''));
foreach ($assos as $asso)
Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.$this->table.'_'.$type.' (`'.pSQL($this->identifier).'`, id_'.$type.')
VALUES('.($new_id_object ? $new_id_object : (int)$asso['id_object']).', '.(int)$asso['id_'.$type].')');
Db::getInstance()->execute('
INSERT INTO '._DB_PREFIX_.$this->table.'_'.$type.' (`'.pSQL($this->identifier).'`, id_'.$type.')
VALUES('.($new_id_object ? $new_id_object : (int)$asso['id_object']).', '.(int)$asso['id_'.$type].')');
}
protected function validateField($value, $field)