|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once('Zend/Gdata/Query.php'); 00028 00040 class Zend_Gdata_Health_Query extends Zend_Gdata_Query 00041 { 00045 const HEALTH_PROFILE_FEED_URI = 00046 'https://www.google.com/health/feeds/profile/default'; 00047 00051 const HEALTH_REGISTER_FEED_URI = 00052 'https://www.google.com/health/feeds/register/default'; 00053 00057 const ITEM_CATEGORY_NS = 'http://schemas.google.com/health/item'; 00058 00064 protected $_defaultFeedUri = self::HEALTH_PROFILE_FEED_URI; 00065 00072 public function setDigest($value) 00073 { 00074 if ($value !== null) { 00075 $this->_params['digest'] = $value; 00076 } 00077 return $this; 00078 } 00079 00085 public function getDigest() 00086 { 00087 if (array_key_exists('digest', $this->_params)) { 00088 return $this->_params['digest']; 00089 } else { 00090 return null; 00091 } 00092 } 00093 00102 public function setCategory($item, $name = null) 00103 { 00104 $this->_category = $item . 00105 ($name ? '/' . urlencode('{' . self::ITEM_CATEGORY_NS . '}' . $name) : null); 00106 return $this; 00107 } 00108 00114 public function getCategory() 00115 { 00116 return $this->_category; 00117 } 00118 00125 public function setGrouped($value) 00126 { 00127 if ($value !== null) { 00128 $this->_params['grouped'] = $value; 00129 } 00130 return $this; 00131 } 00132 00138 public function getGrouped() 00139 { 00140 if (array_key_exists('grouped', $this->_params)) { 00141 return $this->_params['grouped']; 00142 } else { 00143 return null; 00144 } 00145 } 00146 00155 public function setMaxResultsGroup($value) 00156 { 00157 if ($value !== null) { 00158 if ($value <= 0 || $this->getGrouped() !== 'true') { 00159 require_once 'Zend/Gdata/App/InvalidArgumentException.php'; 00160 throw new Zend_Gdata_App_InvalidArgumentException( 00161 'The max-results-group parameter must be set to a value 00162 greater than 0 and can only be used if grouped=true'); 00163 } else { 00164 $this->_params['max-results-group'] = $value; 00165 } 00166 } 00167 return $this; 00168 } 00169 00175 public function getMaxResultsGroup() 00176 { 00177 if (array_key_exists('max-results-group', $this->_params)) { 00178 return $this->_params['max-results-group']; 00179 } else { 00180 return null; 00181 } 00182 } 00183 00193 public function setMaxResultsInGroup($value) 00194 { 00195 if ($value !== null) { 00196 if ($value <= 0 || $this->getGrouped() !== 'true') { 00197 throw new Zend_Gdata_App_InvalidArgumentException( 00198 'The max-results-in-group parameter must be set to a value 00199 greater than 0 and can only be used if grouped=true'); 00200 } else { 00201 $this->_params['max-results-in-group'] = $value; 00202 } 00203 } 00204 return $this; 00205 } 00206 00212 public function getMaxResultsInGroup() 00213 { 00214 if (array_key_exists('max-results-in-group', $this->_params)) { 00215 return $this->_params['max-results-in-group']; 00216 } else { 00217 return null; 00218 } 00219 } 00220 00230 public function setStartIndexGroup($value) 00231 { 00232 if ($value !== null && $this->getGrouped() !== 'true') { 00233 throw new Zend_Gdata_App_InvalidArgumentException( 00234 'The start-index-group can only be used if grouped=true'); 00235 } else { 00236 $this->_params['start-index-group'] = $value; 00237 } 00238 return $this; 00239 } 00240 00246 public function getStartIndexGroup() 00247 { 00248 if (array_key_exists('start-index-group', $this->_params)) { 00249 return $this->_params['start-index-group']; 00250 } else { 00251 return null; 00252 } 00253 } 00254 00262 public function setStartIndexInGroup($value) 00263 { 00264 if ($value !== null && $this->getGrouped() !== 'true') { 00265 throw new Zend_Gdata_App_InvalidArgumentException('start-index-in-group'); 00266 } else { 00267 $this->_params['start-index-in-group'] = $value; 00268 } 00269 return $this; 00270 } 00271 00277 public function getStartIndexInGroup() 00278 { 00279 if (array_key_exists('start-index-in-group', $this->_params)) { 00280 return $this->_params['start-index-in-group']; 00281 } else { 00282 return null; 00283 } 00284 } 00285 }