You are here

private function UcAddressesUcCountryFieldHandler::getAllCountries in Ubercart Addresses 7

Returns all countries installed for Ubercart.

Return value

array List of installed countries in Ubercart.

1 call to UcAddressesUcCountryFieldHandler::getAllCountries()
UcAddressesUcCountryFieldHandler::mapValue in handlers/ubercart.handlers.inc
Overrides UcAddressesFieldHandler::mapValue().

File

handlers/ubercart.handlers.inc, line 558
Field handlers for Ubercart core address fields: first_name, last_name, company, etc.

Class

UcAddressesUcCountryFieldHandler
Class for the Ubercart country field.

Code

private function getAllCountries() {
  static $all_loaded = FALSE;
  if ($all_loaded) {
    return self::$countries;
  }
  $countries = db_select('uc_countries')
    ->fields('uc_countries')
    ->execute()
    ->fetchAll();

  // Index countries.
  foreach ($countries as $country) {
    self::$countries[$country->country_id] = $country;
  }
  $all_loaded = TRUE;
  return self::$countries;
}