You are here

function yr_verdata_locations in Yr Weatherdata 6

Helper function to return all locations.

Return value

Returns an array of locations as objects from the {yr_verdata} table.

1 call to yr_verdata_locations()
yr_verdata_block in ./yr_verdata.module
Implementation of hook_block().

File

./yr_verdata.module, line 155
yr_verdata.module This file provides the yr_verdata forecast module.

Code

function yr_verdata_locations() {
  $sql = "SELECT * FROM {yr_verdata} ORDER BY '%s', 'location' ASC";
  $order = variable_get('yr_verdata_order', 'subregion');
  $result = db_query($sql, $order);
  $rows = array();
  while ($row = db_fetch_object($result)) {
    $rows[] = $row;
  }
  return !empty($rows) ? $rows : array();
}