[-] BO : you cannot create 2 states with the same iso code in the same country anymore #PSCFV-53
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15054 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+5
-5
@@ -113,13 +113,13 @@ class StateCore extends ObjectModel
|
||||
* @param string $iso_code Iso code
|
||||
* @return integer state id
|
||||
*/
|
||||
public static function getIdByIso($iso_code)
|
||||
public static function getIdByIso($iso_code, $id_country = null)
|
||||
{
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT `id_state`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `iso_code` = \''.pSQL($iso_code).'\''
|
||||
);
|
||||
SELECT `id_state`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `iso_code` = \''.pSQL($iso_code).'\'
|
||||
'.($id_country ? 'AND `id_country` = '.(int)$id_country : ''));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user