You are here

function weather_get_places_in_use in Weather 7.2

Same name and namespace in other branches
  1. 7.3 weather.common.inc \weather_get_places_in_use()

Get all currently used places for a display.

Parameters

string $display_type: Display type.

int $display_number: Display number.

Return value

array Array of sorted places.

1 call to weather_get_places_in_use()
weather_block_view in ./weather.module
Implements hook_block_view().

File

./weather.common.inc, line 129
Common functions in a separate file to reduce size of weather.module.

Code

function weather_get_places_in_use($display_type, $display_number) {
  $result = db_query('SELECT * FROM {weather_displays_places}
    WHERE display_type=:type AND display_number=:number ORDER BY weight ASC, displayed_name ASC', array(
    ':type' => $display_type,
    ':number' => $display_number,
  ));
  if ($result
    ->rowCount() == 0) {
    $result = NULL;
  }
  return $result;
}