3
* This file contains the Horde_Service_Weather_Period_Base class for
4
* abstracting access to a single forecast period.
6
* Copyright 2011-2014 Horde LLC (http://www.horde.org/)
8
* @author Michael J Rubinsky <mrubinsk@horde.org>
9
* @license http://www.horde.org/licenses/bsd BSD
11
* @package Service_Weather
15
* Horde_Service_Weather_Period_Base class
17
* @property is_pm Indicates if this is for an evening period.
18
* @property hour Indicates if this is for an hourly period.
19
* @property precipitation_percent Change of precipitation percent.
20
* @property period The cardinal number of this period.
21
* @property humidity Humidity percent.
22
* @property wind_speed Wind speed, in currently configured units.
23
* @property wind_direction Cardinal wind direction e.g., NNW.
24
* @property wind_degrees Wind direction, in degrees.
25
* @property wind_gust Wind gust speed, in currently configured units.
26
* @property snow_total Daily snow totals, in configured units.
27
* @property rain_total Daily rain totals, in configured units.
28
* @property conditions Forecast conditions e.g., "Sunny".
29
* @property icon_url Url to a condition icon.
30
* @property icon Name of condition icon.
31
* @property date Date for this period.
32
* @property high Forecast high temp, in configured units.
33
* @property low Forecast low temp, in configured units.
35
* @author Michael J Rubinsky <mrubinsk@horde.org>
37
* @package Service_Weather
39
class Horde_Service_Weather_Period_Base
42
* Properties for this single peridd, as returned from the forecast request.
46
protected $_properties;
49
* Reference to parent forecast object.
51
* @var Horde_Service_Weather_Forecast_Base;
58
* @param mixed $properties Current properties.
59
* @param Horde_Service_Forecast_Base $forecast The parent forecast.
61
* @return Horde_Service_Weather_Current
63
public function __construct($properties, Horde_Service_Weather_Forecast_Base $forecast)
65
$this->_forecast = $forecast;
66
$this->_properties = $properties;
70
* Default implementation - just return the value set.
72
* @param string $property The requested property.
74
* @return mixed The property value.
75
* @throws Horde_Service_Weather_Exception_InvalidProperty
77
public function __get($property)
79
if (isset($this->_properties[$property])) {
80
return $this->_properties[$property];
83
throw new Horde_Service_Weather_Exception_InvalidProperty('This provider does not support that property');
b'\\ No newline at end of file'