[*] BO : you can now affect a zone to multiple countries and to multiple states

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10865 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot committed 2011-12-02 15:41:05 +00:00
1 parent 457d9b3e97
commit ed98703212
10 files changed
+303 -9

No files matched your search

+14
View File
@@ -336,4 +336,18 @@ class CountryCore extends ObjectModel
FROM `'._DB_PREFIX_.'country`
WHERE `id_country` = '.(int)$id_country);
}
/**
* @param $ids_countries
* @param $id_zone
* @return bool
*/
public function affectZoneToSelection($ids_countries, $id_zone)
{
// cast every array values to int (security)
$ids_countries = array_map('intval', $ids_countries);
return Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'country` SET `id_zone` = '.(int)$id_zone.' WHERE `id_country` IN ('.implode(',', $ids_countries).')
');
}
}