Documentation

Horde_Service_Weather_Base
in package

Horde_Service_Weather_Base class

Tags
author

Michael J Rubinsky mrubinsk@horde.org

category

Horde

Table of Contents

$iconMap  : array<string|int, mixed>
Driver spcific icon map for condition icons. Made public so icons can be overridden in client code if desired.
$link  : string
URL to the provider's site
$logo  : string
URL to a logo for this provider
$title  : string
Title for the provider
$units  : int
Units to display results in.
$_alerts  : mixed
$_cache  : Horde_Cache
Cache object
$_cache_lifetime  : int
Lifetime for cached data.
$_current  : mixed
Local cache of current conditions
$_forecast  : Horde_Service_Weather_Forecast_Base
Local cache of forecast
$_http  : Horde_Http_Client
The http client
$_lastLength  : int
Last requested forecast length.
$_lastLocation  : string
Last location requested.
$_params  : array<string|int, mixed>
Parameters
$_radar  : mixed
$_station  : Horde_Service_Weather_Station
Local cache of station data
__construct()  : mixed
Constructor.
autocompleteLocation()  : array<string|int, mixed>
Searches for locations that begin with the text in $search.
getAlerts()  : array<string|int, mixed>
Return array of weather alerts, if available.
getCurrentConditions()  : Horde_Service_Weather_Current_Base
Returns the current observations.
getForecast()  : Horde_Service_Weather_Forecast_Base
Returns the forecast for the current location.
getRadarImageUrl()  : string|bool
Return the URL to a (possibly animated) radar image.
getStation()  : Horde_Service_Weather_Station
Returns the station information associated with the last request.
getSupportedForecastLengths()  : array<string|int, mixed>
Get array of supported forecast lengths.
getTileServerUrl()  : string|bool
Return the URL a OpenLayers suitable tile server.
getUnits()  : array<string|int, mixed>
Returns a mapping of units for each UNIT type.
searchLocations()  : Horde_Service_Weather_Station
Searches locations.
_ipIsUnique()  : bool
Check if an IP address is a globally unique address and not in RFC1918 or RFC3330 address space.

Properties

$iconMap

Driver spcific icon map for condition icons. Made public so icons can be overridden in client code if desired.

public array<string|int, mixed> $iconMap = array()

URL to the provider's site

public string $link

URL to a logo for this provider

public string $logo

$title

Title for the provider

public string $title

$units

Units to display results in.

public int $units = Horde_Service_Weather::UNITS_STANDARD

$_alerts

protected mixed $_alerts = array()

$_cache

Cache object

protected Horde_Cache $_cache

$_cache_lifetime

Lifetime for cached data.

protected int $_cache_lifetime = 21600

$_current

Local cache of current conditions

protected mixed $_current

$_http

The http client

protected Horde_Http_Client $_http

$_lastLength

Last requested forecast length.

protected int $_lastLength

$_lastLocation

Last location requested.

protected string $_lastLocation

$_params

Parameters

protected array<string|int, mixed> $_params

$_radar

protected mixed $_radar

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

Parameters:

  • cache: (Horde_Cache) Optional Horde_Cache object.
  • cache_lifetime: (integer) Lifetime of cached data, if caching.
  • http_client: (Horde_Http_Client) Required http client object.
Return values
mixed

autocompleteLocation()

Searches for locations that begin with the text in $search.

public autocompleteLocation(string $search) : array<string|int, mixed>
Parameters
$search : string

The text to search.

Tags
throws
Horde_Service_Weather_Exception
Return values
array<string|int, mixed>

An array of stdClass objects with 'name' and 'code' properties.

getAlerts()

Return array of weather alerts, if available.

public getAlerts(mixed $location) : array<string|int, mixed>
Parameters
$location : mixed
Return values
array<string|int, mixed>

getForecast()

Returns the forecast for the current location.

public abstract getForecast(string $location[, int $length = Horde_Service_Weather::FORECAST_3DAY ][, int $type = Horde_Service_Weather::FORECAST_TYPE_STANDARD ]) : Horde_Service_Weather_Forecast_Base
Parameters
$location : string

The location code.

$length : int = Horde_Service_Weather::FORECAST_3DAY

The forecast length, a Horde_Service_Weather::FORECAST_* constant.

$type : int = Horde_Service_Weather::FORECAST_TYPE_STANDARD

The type of forecast to return, a Horde_Service_Weather::FORECAST_TYPE_* constant

Return values
Horde_Service_Weather_Forecast_Base

getRadarImageUrl()

Return the URL to a (possibly animated) radar image.

public getRadarImageUrl(string $location) : string|bool
Parameters
$location : string

The location

Return values
string|bool

The Url, or false if not available.

getSupportedForecastLengths()

Get array of supported forecast lengths.

public abstract getSupportedForecastLengths() : array<string|int, mixed>
Return values
array<string|int, mixed>

The array of supported lengths.

getTileServerUrl()

Return the URL a OpenLayers suitable tile server.

public getTileServerUrl(string $location[, string $type = null ]) : string|bool
Parameters
$location : string

The location.

$type : string = null

The optional layer type.

Return values
string|bool

The Url, or false if not available.

getUnits()

Returns a mapping of units for each UNIT type.

public getUnits([int $type = null ]) : array<string|int, mixed>
Parameters
$type : int = null

The units for measurement. A Horde_Service_Weather::UNITS_* constant.

Return values
array<string|int, mixed>

The mapping of measurements (as keys) and units (as values).

searchLocations()

Searches locations.

public abstract searchLocations(string $location[, int $type = Horde_Service_Weather::SEARCHTYPE_STANDARD ]) : Horde_Service_Weather_Station
Parameters
$location : string

The location string to search.

$type : int = Horde_Service_Weather::SEARCHTYPE_STANDARD

The type of search to perform, a Horde_Service_Weather::SEARCHTYPE_* constant.

Tags
throws
Horde_Service_Weather_Exception
Return values
Horde_Service_Weather_Station

The search location suitable to use directly in a weather request.

Search results