PHP 클래스 Horde_Service_Weather_Owm, horde

저자: Michael J Rubinsky ([email protected])
상속: extends Horde_Service_Weather_Base
파일 보기 프로젝트 열기: horde/horde

공개 프로퍼티들

프로퍼티 타입 설명
$iconMap
$link string
$title string

보호된 프로퍼티들

프로퍼티 타입 설명
$_key string Owm API key.
$_locationCode

공개 메소드들

메소드 설명
__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 ( array $results ) : [type]
_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 ( stdClass $response ) : array Return an array of location search results.
_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() 보호된 메소드

Populates some common data used by forecasts and current conditions.
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 ( array $results ) : [type]
$results array An array of Horde_Service_Weather_Station objects.
리턴 [type]

_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() 보호된 메소드

Return an array of location search results.
protected _parseSearchLocations ( stdClass $response ) : array
$response stdClass The results of a find query.
리턴 array An array of Horde_Service_Weather_Station objects.

_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 보호되어 있는 프로퍼티

Owm API key.
protected string $_key
리턴 string

$_locationCode 보호되어 있는 프로퍼티

protected $_locationCode

$iconMap 공개적으로 프로퍼티

또한 보기: Horde_Service_Weather::$iconMap
public $iconMap

$title 공개적으로 프로퍼티

또한 보기: Horde_Service_Weather_Base::$title
public string $title
리턴 string