You are here

function weather_get_places in Weather 7.2

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 weather.module \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 form for a weather place.

File

./weather.forms.inc, line 537
Provide forms for configuration of weather displays.

Code

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