Application->siteDomainField($country_prefix . 'Country'); if ($iso_format && !$country) { $country = 'USA'; } if (!$iso_format && strlen($country)) { return $this->getCountryId($country); } return $country; } /** * Returns country id based on it's ISO code * * @param string $iso_code * @return int */ function getCountryId($iso_code) { static $cache = null; if (!isset($cache)) { $sql = 'SELECT CountryStateId, IsoCode FROM ' . $this->Application->getUnitOption('country-state', 'TableName') . ' WHERE Type = ' . DESTINATION_TYPE_COUNTRY; $cache = $this->Conn->GetCol($sql, 'IsoCode'); } return $cache[$iso_code]; } }