1: <?php
  2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12: 
 13: 
 14:  15:  16:  17:  18:  19:  20: 
 21: class Horde_Service_Weather_Period_Wwo extends Horde_Service_Weather_Period_Base
 22: {
 23:      24:  25:  26:  27:  28:  29:  30:  31: 
 32:      protected $_map = array();
 33: 
 34:      35:  36:  37:  38:  39:  40:  41: 
 42:     public function __get($property)
 43:     {
 44:         switch ($property) {
 45:         case 'humidity':
 46:         case 'precipitation_percent':
 47:         case 'wind_gust':
 48:         case 'snow_total':
 49:         case 'rain_total':
 50:             return false;
 51: 
 52:         case 'conditions':
 53:             return Horde_Service_Weather_Translation::t($this->_properties->weatherDesc[0]->value);
 54: 
 55:         case 'icon_url':
 56:             return $this->_properties->weatherIconUrl[0]->value;
 57: 
 58:         case 'is_pm':
 59:             return false;
 60: 
 61:         case 'hour':
 62:             return false;
 63: 
 64:         case 'date':
 65:             return new Horde_Date($this->_properties->date);
 66: 
 67:         case 'high':
 68:             if ($this->_forecast->weather->units == Horde_Service_Weather::UNITS_STANDARD) {
 69:                 return $this->_properties->tempMaxF ;
 70:             }
 71:             return $this->_properties->tempMaxC;
 72: 
 73:         case 'low':
 74:             if ($this->_forecast->weather->units == Horde_Service_Weather::UNITS_STANDARD) {
 75:                 return $this->_properties->tempMinF;
 76:             }
 77:             return $this->_properties->tempMinC;
 78: 
 79:         case 'icon':
 80:             return $this->_forecast->weather->iconMap[
 81:                 str_replace('.png', '', basename($this->_properties->weatherIconUrl[0]->value))
 82:             ];
 83: 
 84:         case 'wind_direction':
 85:             return $this->_properties->winddirection;
 86: 
 87:         case 'wind_degrees':
 88:             return $this->_properties->winddirDegree;
 89: 
 90:         case 'wind_speed':
 91:            if ($this->_forecast->weather->units == Horde_Service_Weather::UNITS_STANDARD) {
 92:                return $this->_properties->windspeedMiles;
 93:            }
 94:            return $this->_properties->windspeedKmph;
 95: 
 96:         default:
 97:             throw new Horde_Service_Weather_Exception_InvalidProperty('This provider does not support the "' . $property . '" property');
 98:         }
 99:     }
100: 
101: }