private function UcAddressesUcCountryFieldHandler::getCountry in Ubercart Addresses 6.2
Same name and namespace in other branches
- 7 handlers/ubercart.handlers.inc \UcAddressesUcCountryFieldHandler::getCountry()
Returns country data.
Parameters
int $country_id: The country to get.
Return value
object Data of country if the country is found. NULL otherwise.
1 call to UcAddressesUcCountryFieldHandler::getCountry()
- UcAddressesUcCountryFieldHandler::outputValue in handlers/
ubercart.handlers.inc - Overrides UcAddressesFieldHandler::outputValue().
File
- handlers/
ubercart.handlers.inc, line 319 - Field handlers for Ubercart core address fields: first_name, last_name, company, etc.
Class
- UcAddressesUcCountryFieldHandler
- Class for the Ubercart country field.
Code
private function getCountry($country_id) {
if (isset(self::$countries[$country_id])) {
return self::$countries[$country_id];
}
$result = db_query("SELECT * FROM {uc_countries} WHERE country_id = %d", $country_id);
if ($country = db_fetch_object($result)) {
self::$countries[$country->country_id] = $country;
return $country;
}
return NULL;
}