Property | Type | Description | |
---|---|---|---|
$_db | Horde_Db_Adapter_Base | Database handle. Expects to have the following table available: | |
$_locations | array | Local cache of locations. | |
$_metar_path | string | Default paths to download weather data. | |
$_tableName | string | Name of table containing the NOAA METAR database. | |
$_taf_path |
Method | Description | |
---|---|---|
__construct ( array $params = [] ) | Constructor. | |
autocompleteLocation ( string $search ) : array | Searches for locations that begin with the text in $search. | |
getCurrentConditions ( string $location ) : Horde_Service_Weather_Current_Base | Returns the current observations (METAR). | |
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. | |
getLocations ( ) : array | Return an array containing all available METAR locations/airports. | |
getSupportedForecastLengths ( ) : array | Get array of supported forecast lengths. | |
searchLocations ( string $location, integer $type = Horde_Service_Weather::SEARCHTYPE_STANDARD ) : Horde_Service_Weather_Station | Searches locations. |
Method | Description | |
---|---|---|
_getLocations ( ) : array | Perform DB query to obtain list of airport codes. | |
_getStation ( string $code ) : Horde_Service_Weather_Station | Return a station object matching $code. | |
_makeRequest ( string $url, integer $lifetime = 86400 ) : string | Performs a HTTP request. |
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. - db: (Horde_Db_Adapter_Base) DB Adapter for METAR DB. - metar_path: (string) Path or URL to METAR data. - taf_path: (string) Path or URL to TAF data. |
protected _getLocations ( ) : array | ||
return | array | An array of station information. Each entry contains: - icao: The ICAO identifier of the location. - name: The human readable name of the station. - country: The country the station is located in (if available). |
protected _getStation ( string $code ) : Horde_Service_Weather_Station | ||
$code | string | The ICAO station identifier. |
return | Horde_Service_Weather_Station | The station object. |
public autocompleteLocation ( string $search ) : array | ||
$search | string | The text to search. |
return | array | An array of stdClass objects with 'name' and 'code' properties. |
public getCurrentConditions ( string $location ) : Horde_Service_Weather_Current_Base | ||
$location | string | The location string. |
return | Horde_Service_Weather_Current_Base |
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. (Ignored) |
$type | integer | The type of forecast to return, a Horde_Service_Weather::FORECAST_TYPE_* constant (Ignored) |
return | Horde_Service_Weather_Forecast_Base |
public getLocations ( ) : array | ||
return | array | An array of station information. Each entry contains: - icao: The ICAO identifier of the location. - name: The human readable name of the station. - country: The country the station is located in (if available). |
public getSupportedForecastLengths ( ) : array | ||
return | array | The array of supported lengths. |
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. |
return | Horde_Service_Weather_Station | The search location suitable to use directly in a weather request. |
protected Horde_Db_Adapter_Base $_db | ||
return | Horde_Db_Adapter_Base |
protected array $_locations | ||
return | array |
protected string $_metar_path | ||
return | string |
protected string $_tableName | ||
return | string |