// Changes to controller and AdminCustomers refactoring

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10764 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-11-29 18:35:17 +00:00
parent 557e05ae01
commit 5c61feb04b
6 changed files with 209 additions and 238 deletions
+6 -2
View File
@@ -939,7 +939,6 @@ class CategoryCore extends ObjectModel
return isset($row['id_category']);
}
public function cleanGroups()
{
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'category_group` WHERE `id_category` = '.(int)$this->id);
@@ -1005,10 +1004,15 @@ class CategoryCore extends ObjectModel
return false;
}
/**
* Update customer groups associated to the object
*
* @param array $list groups
*/
public function updateGroup($list)
{
$this->cleanGroups();
if ($list && count($list))
if ($list && !empty($list))
$this->addGroups($list);
else
$this->addGroups(array(1));