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

This commit is contained in:
vChabot
2011-12-02 15:41:05 +00:00
parent 1e1eec8f8d
commit 375ca90e6e
10 changed files with 303 additions and 9 deletions
+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).')
');
}
}