PHP 클래스 Horde_Service_Weather_Base, horde

저자: Michael J Rubinsky ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

보호된 프로퍼티들

프로퍼티 타입 설명
$_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