PHP Класс Horde_Service_Weather_Base, horde

Автор: Michael J Rubinsky ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$iconMap array 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 integer Units to display results in.

Защищенные свойства (Protected)

Свойство Тип Описание
$_alerts
$_cache Horde_Cache Cache object
$_cache_lifetime integer Lifetime for cached data.
$_current Local cache of current conditions
$_forecast Horde_Service_Weather_Forecast_Base Local cache of forecast
$_http Horde_Http_Client The http client
$_lastLength integer Last requested forecast length.
$_lastLocation string Last location requested.
$_params array Parameters
$_radar
$_station Horde_Service_Weather_Station Local cache of station data

Открытые методы

Метод Описание
__construct ( array $params = [] ) Constructor.
autocompleteLocation ( string $search ) : array Searches for locations that begin with the text in $search.
getAlerts ( $location ) : array Return array of weather alerts, if available.
getCurrentConditions ( string $location ) : Horde_Service_Weather_Current_Base Returns the current observations.
getForecast ( string $location, integer $length = Horde_Service_Weather::FORECAST_3DAY, integer $type = Horde_Service_Weather::FORECAST_TYPE_STANDARD ) : Horde_Service_Weather_Forecast_Base Returns the forecast for the current location.
getRadarImageUrl ( string $location ) : string | boolean 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 Get array of supported forecast lengths.
getTileServerUrl ( string $location, string $type = null ) : string | boolean Return the URL a OpenLayers suitable tile server.
getUnits ( integer $type = null ) : array Returns a mapping of units for each UNIT type.
searchLocations ( string $location, integer $type = Horde_Service_Weather::SEARCHTYPE_STANDARD ) : Horde_Service_Weather_Station Searches locations.

Защищенные методы

Метод Описание
_ipIsUnique ( string $ip ) : boolean Check if an IP address is a globally unique address and not in RFC1918 or RFC3330 address space.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $params = [] )
$params 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.

_ipIsUnique() защищенный Метод

Check if an IP address is a globally unique address and not in RFC1918 or RFC3330 address space.
protected _ipIsUnique ( string $ip ) : boolean
$ip string The IPv4 IP address to check.
Результат boolean True if the IP address is globally unique, otherwise false.

autocompleteLocation() публичный Метод

Searches for locations that begin with the text in $search.
public autocompleteLocation ( string $search ) : array
$search string The text to search.
Результат array An array of stdClass objects with 'name' and 'code' properties.

getAlerts() публичный Метод

Return array of weather alerts, if available.
public getAlerts ( $location ) : array
Результат array

getCurrentConditions() абстрактный публичный Метод

Returns the current observations.
abstract public getCurrentConditions ( string $location ) : Horde_Service_Weather_Current_Base
$location string The location string.
Результат Horde_Service_Weather_Current_Base

getForecast() абстрактный публичный Метод

Returns the forecast for the current location.
abstract public getForecast ( string $location, integer $length = Horde_Service_Weather::FORECAST_3DAY, integer $type = Horde_Service_Weather::FORECAST_TYPE_STANDARD ) : Horde_Service_Weather_Forecast_Base
$location string The location code.
$length integer The forecast length, a Horde_Service_Weather::FORECAST_* constant.
$type integer The type of forecast to return, a Horde_Service_Weather::FORECAST_TYPE_* constant
Результат Horde_Service_Weather_Forecast_Base

getRadarImageUrl() публичный Метод

Return the URL to a (possibly animated) radar image.
public getRadarImageUrl ( string $location ) : string | boolean
$location string The location
Результат string | boolean The Url, or false if not available.

getStation() публичный Метод

Returns the station information associated with the last request.
public getStation ( ) : Horde_Service_Weather_Station
Результат Horde_Service_Weather_Station

getSupportedForecastLengths() абстрактный публичный Метод

Get array of supported forecast lengths.
abstract public getSupportedForecastLengths ( ) : array
Результат array The array of supported lengths.

getTileServerUrl() публичный Метод

Return the URL a OpenLayers suitable tile server.
public getTileServerUrl ( string $location, string $type = null ) : string | boolean
$location string The location.
$type string The optional layer type.
Результат string | boolean The Url, or false if not available.

getUnits() публичный Метод

Returns a mapping of units for each UNIT type.
public getUnits ( integer $type = null ) : array
$type integer The units for measurement. A Horde_Service_Weather::UNITS_* constant.
Результат array The mapping of measurements (as keys) and units (as values).

searchLocations() абстрактный публичный Метод

Searches locations.
abstract public searchLocations ( string $location, integer $type = Horde_Service_Weather::SEARCHTYPE_STANDARD ) : Horde_Service_Weather_Station
$location string The location string to search.
$type integer The type of search to perform, a Horde_Service_Weather::SEARCHTYPE_* constant.
Результат Horde_Service_Weather_Station The search location suitable to use directly in a weather request.

Описание свойств

$_alerts защищенное свойство

protected $_alerts

$_cache защищенное свойство

Cache object
protected Horde_Cache $_cache
Результат Horde_Cache

$_cache_lifetime защищенное свойство

Lifetime for cached data.
protected int $_cache_lifetime
Результат integer

$_current защищенное свойство

Local cache of current conditions
protected $_current

$_forecast защищенное свойство

Local cache of forecast
protected Horde_Service_Weather_Forecast_Base $_forecast
Результат Horde_Service_Weather_Forecast_Base

$_http защищенное свойство

The http client
protected Horde_Http_Client $_http
Результат Horde_Http_Client

$_lastLength защищенное свойство

Last requested forecast length.
protected int $_lastLength
Результат integer

$_lastLocation защищенное свойство

Last location requested.
protected string $_lastLocation
Результат string

$_params защищенное свойство

Parameters
protected array $_params
Результат array

$_radar защищенное свойство

protected $_radar

$_station защищенное свойство

Local cache of station data
protected Horde_Service_Weather_Station $_station
Результат Horde_Service_Weather_Station

$iconMap публичное свойство

Driver spcific icon map for condition icons. Made public so icons can be overridden in client code if desired.
public array $iconMap
Результат array

$title публичное свойство

Title for the provider
public string $title
Результат string

$units публичное свойство

Units to display results in.
public int $units
Результат integer