~ubuntu-branches/ubuntu/vivid/php-horde-service-weather/vivid-proposed

« back to all changes in this revision

Viewing changes to Horde_Service_Weather-2.1.3/lib/Horde/Service/Weather/Period/Base.php

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2014-10-16 21:46:14 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20141016214614-no8xuhfj8ofsey56
Tags: 2.1.4-1
New upstream version 2.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/**
3
 
 * This file contains the Horde_Service_Weather_Period_Base class for
4
 
 * abstracting access to a single forecast period.
5
 
 *
6
 
 * Copyright 2011-2014 Horde LLC (http://www.horde.org/)
7
 
 *
8
 
 * @author   Michael J Rubinsky <mrubinsk@horde.org>
9
 
 * @license  http://www.horde.org/licenses/bsd BSD
10
 
 * @category Horde
11
 
 * @package  Service_Weather
12
 
 */
13
 
 
14
 
/**
15
 
 * Horde_Service_Weather_Period_Base class
16
 
 *
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.
34
 
 *
35
 
 * @author   Michael J Rubinsky <mrubinsk@horde.org>
36
 
 * @category Horde
37
 
 * @package  Service_Weather
38
 
 */
39
 
class Horde_Service_Weather_Period_Base
40
 
{
41
 
    /**
42
 
     * Properties for this single peridd, as returned from the forecast request.
43
 
     *
44
 
     * @var mixed
45
 
     */
46
 
    protected $_properties;
47
 
 
48
 
    /**
49
 
     * Reference to parent forecast object.
50
 
     *
51
 
     * @var Horde_Service_Weather_Forecast_Base;
52
 
     */
53
 
    protected $_forecast;
54
 
 
55
 
    /**
56
 
     * Const'r
57
 
     *
58
 
     * @param mixed $properties                      Current properties.
59
 
     * @param Horde_Service_Forecast_Base $forecast  The parent forecast.
60
 
     *
61
 
     * @return Horde_Service_Weather_Current
62
 
     */
63
 
    public function __construct($properties, Horde_Service_Weather_Forecast_Base $forecast)
64
 
    {
65
 
        $this->_forecast = $forecast;
66
 
        $this->_properties = $properties;
67
 
    }
68
 
 
69
 
    /**
70
 
     * Default implementation - just return the value set.
71
 
     *
72
 
     * @param string $property  The requested property.
73
 
     *
74
 
     * @return mixed  The property value.
75
 
     * @throws  Horde_Service_Weather_Exception_InvalidProperty
76
 
     */
77
 
    public function __get($property)
78
 
    {
79
 
        if (isset($this->_properties[$property])) {
80
 
            return $this->_properties[$property];
81
 
        }
82
 
 
83
 
        throw new Horde_Service_Weather_Exception_InvalidProperty('This provider does not support that property');
84
 
    }
85
 
 
86
 
 }
 
 
b'\\ No newline at end of file'