Zend_Gdata_Spreadsheets_ListQuery

Assists in constructing queries for Google Spreadsheets lists.

Defined (1)

The class is defined in the following location(s).

/inc/VideoUploader/includes/Zend/Gdata/Spreadsheets/ListQuery.php  
  1. class Zend_Gdata_Spreadsheets_ListQuery extends Zend_Gdata_Query 
  2.  
  3. const SPREADSHEETS_LIST_FEED_URI = 'https://spreadsheets.google.com/feeds/list'; 
  4.  
  5. protected $_defaultFeedUri = self::SPREADSHEETS_LIST_FEED_URI; 
  6. protected $_visibility = 'private'; 
  7. protected $_projection = 'full'; 
  8. protected $_spreadsheetKey = null; 
  9. protected $_worksheetId = 'default'; 
  10. protected $_rowId = null; 
  11.  
  12. /** 
  13. * Constructs a new Zend_Gdata_Spreadsheets_ListQuery object. 
  14. */ 
  15. public function __construct() 
  16. parent::__construct(); 
  17.  
  18. /** 
  19. * Sets the spreadsheet key for the query. 
  20. * @param string $value 
  21. * @return Zend_Gdata_Spreadsheets_CellQuery Provides a fluent interface 
  22. */ 
  23. public function setSpreadsheetKey($value) 
  24. $this->_spreadsheetKey = $value; 
  25. return $this; 
  26.  
  27. /** 
  28. * Gets the spreadsheet key for the query. 
  29. * @return string spreadsheet key 
  30. */ 
  31. public function getSpreadsheetKey() 
  32. return $this->_spreadsheetKey; 
  33.  
  34. /** 
  35. * Sets the worksheet id for the query. 
  36. * @param string $value 
  37. * @return Zend_Gdata_Spreadsheets_CellQuery Provides a fluent interface 
  38. */ 
  39. public function setWorksheetId($value) 
  40. $this->_worksheetId = $value; 
  41. return $this; 
  42.  
  43. /** 
  44. * Gets the worksheet id for the query. 
  45. * @return string worksheet id 
  46. */ 
  47. public function getWorksheetId() 
  48. return $this->_worksheetId; 
  49.  
  50. /** 
  51. * Sets the row id for the query. 
  52. * @param string $value row id 
  53. * @return Zend_Gdata_Spreadsheets_CellQuery Provides a fluent interface 
  54. */ 
  55. public function setRowId($value) 
  56. $this->_rowId = $value; 
  57. return $this; 
  58.  
  59. /** 
  60. * Gets the row id for the query. 
  61. * @return string row id 
  62. */ 
  63. public function getRowId() 
  64. return $this->_rowId; 
  65.  
  66. /** 
  67. * Sets the projection for the query. 
  68. * @param string $value Projection 
  69. * @return Zend_Gdata_Spreadsheets_ListQuery Provides a fluent interface 
  70. */ 
  71. public function setProjection($value) 
  72. $this->_projection = $value; 
  73. return $this; 
  74.  
  75. /** 
  76. * Sets the visibility for this query. 
  77. * @param string $value visibility 
  78. * @return Zend_Gdata_Spreadsheets_ListQuery Provides a fluent interface 
  79. */ 
  80. public function setVisibility($value) 
  81. $this->_visibility = $value; 
  82. return $this; 
  83.  
  84. /** 
  85. * Gets the projection for this query. 
  86. * @return string projection 
  87. */ 
  88. public function getProjection() 
  89. return $this->_projection; 
  90.  
  91. /** 
  92. * Gets the visibility for this query. 
  93. * @return string visibility 
  94. */ 
  95. public function getVisibility() 
  96. return $this->_visibility; 
  97.  
  98. /** 
  99. * Sets the spreadsheet key for this query. 
  100. * @param string $value 
  101. * @return Zend_Gdata_Spreadsheets_DocumentQuery Provides a fluent interface 
  102. */ 
  103. public function setSpreadsheetQuery($value) 
  104. if ($value != null) { 
  105. $this->_params['sq'] = $value; 
  106. } else { 
  107. unset($this->_params['sq']); 
  108. return $this; 
  109.  
  110. /** 
  111. * Gets the spreadsheet key for this query. 
  112. * @return string spreadsheet query 
  113. */ 
  114. public function getSpreadsheetQuery() 
  115. if (array_key_exists('sq', $this->_params)) { 
  116. return $this->_params['sq']; 
  117. } else { 
  118. return null; 
  119.  
  120. /** 
  121. * Sets the orderby attribute for this query. 
  122. * @param string $value 
  123. * @return Zend_Gdata_Spreadsheets_DocumentQuery Provides a fluent interface 
  124. */ 
  125. public function setOrderBy($value) 
  126. if ($value != null) { 
  127. $this->_params['orderby'] = $value; 
  128. } else { 
  129. unset($this->_params['orderby']); 
  130. return $this; 
  131.  
  132. /** 
  133. * Gets the orderby attribute for this query. 
  134. * @return string orderby 
  135. */ 
  136. public function getOrderBy() 
  137. if (array_key_exists('orderby', $this->_params)) { 
  138. return $this->_params['orderby']; 
  139. } else { 
  140. return null; 
  141.  
  142. /** 
  143. * Sets the reverse attribute for this query. 
  144. * @param string $value 
  145. * @return Zend_Gdata_Spreadsheets_DocumentQuery Provides a fluent interface 
  146. */ 
  147. public function setReverse($value) 
  148. if ($value != null) { 
  149. $this->_params['reverse'] = $value; 
  150. } else { 
  151. unset($this->_params['reverse']); 
  152. return $this; 
  153.  
  154. /** 
  155. * Gets the reverse attribute for this query. 
  156. * @return string reverse 
  157. */ 
  158. public function getReverse() 
  159.  
  160.  
  161. if (array_key_exists('reverse', $this->_params)) { 
  162. return $this->_params['reverse']; 
  163. } else { 
  164. return null; 
  165.  
  166. /** 
  167. * Gets the full query URL for this query. 
  168. * @return string url 
  169. */ 
  170. public function getQueryUrl() 
  171.  
  172. $uri = $this->_defaultFeedUri; 
  173.  
  174. if ($this->_spreadsheetKey != null) { 
  175. $uri .= '/'.$this->_spreadsheetKey; 
  176. } else { 
  177. require_once 'Zend/Gdata/App/Exception.php'; 
  178. throw new Zend_Gdata_App_Exception('A spreadsheet key must be provided for list queries.'); 
  179.  
  180. if ($this->_worksheetId != null) { 
  181. $uri .= '/'.$this->_worksheetId; 
  182. } else { 
  183. require_once 'Zend/Gdata/App/Exception.php'; 
  184. throw new Zend_Gdata_App_Exception('A worksheet id must be provided for list queries.'); 
  185.  
  186. if ($this->_visibility != null) { 
  187. $uri .= '/'.$this->_visibility; 
  188. } else { 
  189. require_once 'Zend/Gdata/App/Exception.php'; 
  190. throw new Zend_Gdata_App_Exception('A visibility must be provided for list queries.'); 
  191.  
  192. if ($this->_projection != null) { 
  193. $uri .= '/'.$this->_projection; 
  194. } else { 
  195. require_once 'Zend/Gdata/App/Exception.php'; 
  196. throw new Zend_Gdata_App_Exception('A projection must be provided for list queries.'); 
  197.  
  198. if ($this->_rowId != null) { 
  199. $uri .= '/'.$this->_rowId; 
  200.  
  201. $uri .= $this->getQueryString(); 
  202. return $uri; 
  203.  
  204. /** 
  205. * Gets the attribute query string for this query. 
  206. * @return string query string 
  207. */ 
  208. public function getQueryString() 
  209. return parent::getQueryString(); 
  210.