PHP Класс Horde_Service_Weather_Wwo, horde

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

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

Свойство Тип Описание
$iconMap
$link string
$title string

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

Свойство Тип Описание
$_key string Wwo API key.
$_version integer API Version

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

Метод Описание
__construct ( array $params = [] ) : Horde_Service_Weather_Wwo Constructor.
autocompleteLocation ( $search ) Return an autocomplete request result.
getCurrentConditions ( $location ) : Horde_Service_Weather_Current_Wwo Obtain the current observations.
getForecast ( $location, $length = Horde_Service_Weather::FORECAST_3DAY, $type = Horde_Service_Weather::FORECAST_TYPE_STANDARD ) Obtain the forecast for the current location.
getSupportedForecastLengths ( ) Return the supported forecast lengths.
searchLocations ( $location, $type = Horde_Service_Weather::SEARCHTYPE_STANDARD ) Search for a valid location code.

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

Метод Описание
_getCommonElements ( string $location, integer $length = Horde_Service_Weather::FORECAST_5DAY ) Populates some common data used by forecasts and current conditions.
_makeRequest ( Horde_Url $url ) : mixed Make the remote API call.
_parseAutocomplete ( $results )
_parseCurrent ( stdClass $current ) : Horde_Service_Weather_Current Parse the current_conditions response.
_parseForecast ( stdClass $forecast ) : Horde_Service_Weather_Forecast_Wwo Parses the forecast data.
_parseSearchLocations ( $response )
_parseStation ( StdClass $station ) : Horde_Service_Weather_Station Parses the JSON response for a location request into a station object.
_searchLocations ( string $location ) : string Execute a location search.

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

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

Constructor.
public __construct ( array $params = [] ) : Horde_Service_Weather_Wwo
$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. - apikey: (string) Require api key for Wwo. - apiVersion: (integer) Version of the API to use. Defaults to v1 for BC reasons.
Результат Horde_Service_Weather_Wwo

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

Weather Underground allows requesting multiple features per request, and only counts it as a single request against your API key. So we trade a bit of request time/traffic for a smaller number of requests to obtain information for e.g., a typical weather portal display.
protected _getCommonElements ( string $location, integer $length = Horde_Service_Weather::FORECAST_5DAY )
$location string The location identifier.
$length integer The forecast length.

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

Make the remote API call.
protected _makeRequest ( Horde_Url $url ) : mixed
$url Horde_Url The endpoint.
Результат mixed The unserialized results form the remote API call.

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

protected _parseAutocomplete ( $results )

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

Parse the current_conditions response.
protected _parseCurrent ( stdClass $current ) : Horde_Service_Weather_Current
$current stdClass The current_condition request response object
Результат Horde_Service_Weather_Current

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

Parses the forecast data.
protected _parseForecast ( stdClass $forecast ) : Horde_Service_Weather_Forecast_Wwo
$forecast stdClass The result of the forecast request.
Результат Horde_Service_Weather_Forecast_Wwo The forecast.

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

protected _parseSearchLocations ( $response )

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

Parses the JSON response for a location request into a station object.
protected _parseStation ( StdClass $station ) : Horde_Service_Weather_Station
$station StdClass The response from a Location request.
Результат Horde_Service_Weather_Station

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

Execute a location search.
protected _searchLocations ( string $location ) : string
$location string The location text to search.
Результат string The location code result(s).

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

Return an autocomplete request result.
См. также: Horde_Service_Weather_Base::autocompleteLocation
public autocompleteLocation ( $search )

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

Obtain the current observations.
См. также: Horde_Service_Weather_Base::getCurrentConditions
public getCurrentConditions ( $location ) : Horde_Service_Weather_Current_Wwo
Результат Horde_Service_Weather_Current_Wwo

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

Obtain the forecast for the current location.
См. также: Horde_Service_Weather_Base::getForecast
public getForecast ( $location, $length = Horde_Service_Weather::FORECAST_3DAY, $type = Horde_Service_Weather::FORECAST_TYPE_STANDARD )

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

Return the supported forecast lengths.
См. также: Horde_Service_Weather_Base::getSupportedForecastLengths

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

Search for a valid location code.
См. также: Horde_Service_Weather_Base::searchLocations
public searchLocations ( $location, $type = Horde_Service_Weather::SEARCHTYPE_STANDARD )

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

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

Wwo API key.
protected string $_key
Результат string

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

API Version
protected int $_version
Результат integer

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

См. также: Horde_Service_Weather::$iconMap
public $iconMap

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

См. также: Horde_Service_Weather_Base::$title
public string $title
Результат string