You are here

function weather_get_places in Weather 7

Same name and namespace in other branches
  1. 6.5 weather.module \weather_get_places()
  2. 7.3 weather.forms.inc \weather_get_places()
  3. 7.2 weather.forms.inc \weather_get_places()

Get all places for a country.

Parameters

string $country: Country for which the placed should be returned.

Return value

array Array of sorted places.

1 call to weather_get_places()
weather_location_settings_form in ./weather.forms.inc
Create a settings form for a weather location.

File

./weather.module, line 545
Display current weather data from many places in the world.

Code

function weather_get_places($country) {
  $result = db_query('SELECT icao, name FROM {weather_icao} WHERE country=:country ORDER BY name ASC', array(
    ':country' => $country,
  ));
  foreach ($result as $row) {
    $places[$row->icao] = $row->name;
  }
  return $places;
}