14 * to license@zend.com so we can send you a copy immediately. |
14 * to license@zend.com so we can send you a copy immediately. |
15 * |
15 * |
16 * @category Zend |
16 * @category Zend |
17 * @package Zend_Gdata |
17 * @package Zend_Gdata |
18 * @subpackage Gbase |
18 * @subpackage Gbase |
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
21 * @version $Id: Query.php 20096 2010-01-06 02:05:09Z bkarwin $ |
21 * @version $Id: Query.php 24777 2012-05-08 18:50:23Z adamlundrigan $ |
22 */ |
22 */ |
|
23 |
|
24 /** |
|
25 * @see Zend_Exception |
|
26 */ |
|
27 require_once 'Zend/Exception.php'; |
23 |
28 |
24 /** |
29 /** |
25 * @see Zend_Gdata_Query |
30 * @see Zend_Gdata_Query |
26 */ |
31 */ |
27 require_once('Zend/Gdata/Query.php'); |
32 require_once 'Zend/Gdata/Query.php'; |
28 |
33 |
29 /** |
34 /** |
30 * Assists in constructing queries for Google Base |
35 * Assists in constructing queries for Google Base |
31 * |
36 * |
32 * @link http://code.google.com/apis/base |
37 * @link http://code.google.com/apis/base |
33 * |
38 * |
34 * @category Zend |
39 * @category Zend |
35 * @package Zend_Gdata |
40 * @package Zend_Gdata |
36 * @subpackage Gbase |
41 * @subpackage Gbase |
37 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
42 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
38 * @license http://framework.zend.com/license/new-bsd New BSD License |
43 * @license http://framework.zend.com/license/new-bsd New BSD License |
39 */ |
44 */ |
40 class Zend_Gdata_Gbase_Query extends Zend_Gdata_Query |
45 class Zend_Gdata_Gbase_Query extends Zend_Gdata_Query |
41 { |
46 { |
42 |
47 |
43 /** |
48 /** |
44 * Path to the customer items feeds on the Google Base server. |
49 * Path to the customer items feeds on the Google Base server. |
45 */ |
50 */ |
46 const GBASE_ITEM_FEED_URI = 'http://www.google.com/base/feeds/items'; |
51 const GBASE_ITEM_FEED_URI = 'https://www.google.com/base/feeds/items'; |
47 |
52 |
48 /** |
53 /** |
49 * Path to the snippets feeds on the Google Base server. |
54 * Path to the snippets feeds on the Google Base server. |
50 */ |
55 */ |
51 const GBASE_SNIPPET_FEED_URI = 'http://www.google.com/base/feeds/snippets'; |
56 const GBASE_SNIPPET_FEED_URI = 'https://www.google.com/base/feeds/snippets'; |
52 |
57 |
53 /** |
58 /** |
54 * The default URI for POST methods |
59 * Create Gdata_Query object |
55 * |
|
56 * @var string |
|
57 */ |
60 */ |
58 protected $_defaultFeedUri = self::GBASE_ITEM_FEED_URI; |
61 public function __construct($url = null) |
59 |
|
60 /** |
|
61 * @param string $value |
|
62 * @return Zend_Gdata_Gbase_Query Provides a fluent interface |
|
63 */ |
|
64 public function setKey($value) |
|
65 { |
62 { |
66 if ($value !== null) { |
63 throw new Zend_Exception( |
67 $this->_params['key'] = $value; |
64 'Google Base API has been discontinued by Google and was removed' |
68 } else { |
65 . ' from Zend Framework in 1.12.0. For more information see: ' |
69 unset($this->_params['key']); |
66 . 'http://googlemerchantblog.blogspot.ca/2010/12/new-shopping-apis-and-deprecation-of.html' |
70 } |
67 ); |
71 return $this; |
|
72 } |
68 } |
73 |
|
74 /** |
|
75 * @param string $value |
|
76 * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface |
|
77 */ |
|
78 public function setBq($value) |
|
79 { |
|
80 if ($value !== null) { |
|
81 $this->_params['bq'] = $value; |
|
82 } else { |
|
83 unset($this->_params['bq']); |
|
84 } |
|
85 return $this; |
|
86 } |
|
87 |
|
88 /** |
|
89 * @param string $value |
|
90 * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface |
|
91 */ |
|
92 public function setRefine($value) |
|
93 { |
|
94 if ($value !== null) { |
|
95 $this->_params['refine'] = $value; |
|
96 } else { |
|
97 unset($this->_params['refine']); |
|
98 } |
|
99 return $this; |
|
100 } |
|
101 |
|
102 /** |
|
103 * @param string $value |
|
104 * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface |
|
105 */ |
|
106 public function setContent($value) |
|
107 { |
|
108 if ($value !== null) { |
|
109 $this->_params['content'] = $value; |
|
110 } else { |
|
111 unset($this->_params['content']); |
|
112 } |
|
113 return $this; |
|
114 } |
|
115 |
|
116 /** |
|
117 * @param string $value |
|
118 * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface |
|
119 */ |
|
120 public function setOrderBy($value) |
|
121 { |
|
122 if ($value !== null) { |
|
123 $this->_params['orderby'] = $value; |
|
124 } else { |
|
125 unset($this->_params['orderby']); |
|
126 } |
|
127 return $this; |
|
128 } |
|
129 |
|
130 /** |
|
131 * @param string $value |
|
132 * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface |
|
133 */ |
|
134 public function setSortOrder($value) |
|
135 { |
|
136 if ($value !== null) { |
|
137 $this->_params['sortorder'] = $value; |
|
138 } else { |
|
139 unset($this->_params['sortorder']); |
|
140 } |
|
141 return $this; |
|
142 } |
|
143 |
|
144 /** |
|
145 * @param string $value |
|
146 * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface |
|
147 */ |
|
148 public function setCrowdBy($value) |
|
149 { |
|
150 if ($value !== null) { |
|
151 $this->_params['crowdby'] = $value; |
|
152 } else { |
|
153 unset($this->_params['crowdby']); |
|
154 } |
|
155 return $this; |
|
156 } |
|
157 |
|
158 /** |
|
159 * @param string $value |
|
160 * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface |
|
161 */ |
|
162 public function setAdjust($value) |
|
163 { |
|
164 if ($value !== null) { |
|
165 $this->_params['adjust'] = $value; |
|
166 } else { |
|
167 unset($this->_params['adjust']); |
|
168 } |
|
169 return $this; |
|
170 } |
|
171 |
|
172 /** |
|
173 * @return string key |
|
174 */ |
|
175 public function getKey() |
|
176 { |
|
177 if (array_key_exists('key', $this->_params)) { |
|
178 return $this->_params['key']; |
|
179 } else { |
|
180 return null; |
|
181 } |
|
182 } |
|
183 |
|
184 /** |
|
185 * @return string bq |
|
186 */ |
|
187 public function getBq() |
|
188 { |
|
189 if (array_key_exists('bq', $this->_params)) { |
|
190 return $this->_params['bq']; |
|
191 } else { |
|
192 return null; |
|
193 } |
|
194 } |
|
195 |
|
196 /** |
|
197 * @return string refine |
|
198 */ |
|
199 public function getRefine() |
|
200 { |
|
201 if (array_key_exists('refine', $this->_params)) { |
|
202 return $this->_params['refine']; |
|
203 } else { |
|
204 return null; |
|
205 } |
|
206 } |
|
207 |
|
208 /** |
|
209 * @return string content |
|
210 */ |
|
211 public function getContent() |
|
212 { |
|
213 if (array_key_exists('content', $this->_params)) { |
|
214 return $this->_params['content']; |
|
215 } else { |
|
216 return null; |
|
217 } |
|
218 } |
|
219 |
|
220 /** |
|
221 * @return string orderby |
|
222 */ |
|
223 public function getOrderBy() |
|
224 { |
|
225 if (array_key_exists('orderby', $this->_params)) { |
|
226 return $this->_params['orderby']; |
|
227 } else { |
|
228 return null; |
|
229 } |
|
230 } |
|
231 |
|
232 /** |
|
233 * @return string sortorder |
|
234 */ |
|
235 public function getSortOrder() |
|
236 { |
|
237 if (array_key_exists('sortorder', $this->_params)) { |
|
238 return $this->_params['sortorder']; |
|
239 } else { |
|
240 return null; |
|
241 } |
|
242 } |
|
243 |
|
244 /** |
|
245 * @return string crowdby |
|
246 */ |
|
247 public function getCrowdBy() |
|
248 { |
|
249 if (array_key_exists('crowdby', $this->_params)) { |
|
250 return $this->_params['crowdby']; |
|
251 } else { |
|
252 return null; |
|
253 } |
|
254 } |
|
255 |
|
256 /** |
|
257 * @return string adjust |
|
258 */ |
|
259 public function getAdjust() |
|
260 { |
|
261 if (array_key_exists('adjust', $this->_params)) { |
|
262 return $this->_params['adjust']; |
|
263 } else { |
|
264 return null; |
|
265 } |
|
266 } |
|
267 |
|
268 } |
69 } |