source: trunk/www.guidonia.net/wp/wp-content/plugins/webtv/Drivers/Zend/Gdata/Photos/UserEntry.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 11.0 KB
Line 
1<?php
2
3/**
4 * Zend Framework
5 *
6 * LICENSE
7 *
8 * This source file is subject to the new BSD license that is bundled
9 * with this package in the file LICENSE.txt.
10 * It is also available through the world-wide-web at this URL:
11 * http://framework.zend.com/license/new-bsd
12 * If you did not receive a copy of the license and are unable to
13 * obtain it through the world-wide-web, please send an email
14 * to license@zend.com so we can send you a copy immediately.
15 *
16 * @category Zend
17 * @package Zend_Gdata
18 * @subpackage Photos
19 * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 */
22
23/**
24 * @see Zend_Gdata_Entry
25 */
26require_once 'Zend/Gdata/Entry.php';
27
28/**
29 * @see Zend_Gdata_Gapps
30 */
31require_once 'Zend/Gdata/Gapps.php';
32
33/**
34 * @see Zend_Gdata_Photos_Extension_Nickname
35 */
36require_once 'Zend/Gdata/Photos/Extension/Nickname.php';
37
38/**
39 * @see Zend_Gdata_Photos_Extension_Thumbnail
40 */
41require_once 'Zend/Gdata/Photos/Extension/Thumbnail.php';
42
43/**
44 * @see Zend_Gdata_Photos_Extension_QuotaCurrent
45 */
46require_once 'Zend/Gdata/Photos/Extension/QuotaCurrent.php';
47
48/**
49 * @see Zend_Gdata_Photos_Extension_QuotaLimit
50 */
51require_once 'Zend/Gdata/Photos/Extension/QuotaLimit.php';
52
53/**
54 * @see Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum
55 */
56require_once 'Zend/Gdata/Photos/Extension/MaxPhotosPerAlbum.php';
57
58/**
59 * @see Zend_Gdata_Photos_Extension_User
60 */
61require_once 'Zend/Gdata/Photos/Extension/User.php';
62
63/**
64 * @see Zend_Gdata_App_Extension_Category
65 */
66require_once 'Zend/Gdata/App/Extension/Category.php';
67
68/**
69 * Data model class for a User Entry.
70 *
71 * To transfer user entries to and from the servers, including
72 * creating new entries, refer to the service class,
73 * Zend_Gdata_Photos.
74 *
75 * This class represents <atom:entry> in the Google Data protocol.
76 *
77 * @category Zend
78 * @package Zend_Gdata
79 * @subpackage Photos
80 * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
81 * @license http://framework.zend.com/license/new-bsd New BSD License
82 */
83class Zend_Gdata_Photos_UserEntry extends Zend_Gdata_Entry
84{
85
86 protected $_entryClassName = 'Zend_Gdata_Photos_UserEntry';
87
88 /**
89 * gphoto:nickname element
90 *
91 * @var Zend_Gdata_Photos_Extension_Nickname
92 */
93 protected $_gphotoNickname = null;
94
95 /**
96 * gphoto:user element
97 *
98 * @var Zend_Gdata_Photos_Extension_User
99 */
100 protected $_gphotoUser = null;
101
102 /**
103 * gphoto:thumbnail element
104 *
105 * @var Zend_Gdata_Photos_Extension_Thumbnail
106 */
107 protected $_gphotoThumbnail = null;
108
109 /**
110 * gphoto:quotalimit element
111 *
112 * @var Zend_Gdata_Photos_Extension_QuotaLimit
113 */
114 protected $_gphotoQuotaLimit = null;
115
116 /**
117 * gphoto:quotacurrent element
118 *
119 * @var Zend_Gdata_Photos_Extension_QuotaCurrent
120 */
121 protected $_gphotoQuotaCurrent = null;
122
123 /**
124 * gphoto:maxPhotosPerAlbum element
125 *
126 * @var Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum
127 */
128 protected $_gphotoMaxPhotosPerAlbum = null;
129
130 /**
131 * Create a new instance.
132 *
133 * @param DOMElement $element (optional) DOMElement from which this
134 * object should be constructed.
135 */
136 public function __construct($element = null)
137 {
138 $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces);
139 parent::__construct($element);
140
141 $category = new Zend_Gdata_App_Extension_Category(
142 'http://schemas.google.com/photos/2007#user',
143 'http://schemas.google.com/g/2005#kind');
144 $this->setCategory(array($category));
145 }
146
147 /**
148 * Retrieves a DOMElement which corresponds to this element and all
149 * child properties. This is used to build an entry back into a DOM
150 * and eventually XML text for application storage/persistence.
151 *
152 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
153 * @return DOMElement The DOMElement representing this element and all
154 * child properties.
155 */
156 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
157 {
158 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
159 if ($this->_gphotoNickname !== null) {
160 $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument));
161 }
162 if ($this->_gphotoThumbnail !== null) {
163 $element->appendChild($this->_gphotoThumbnail->getDOM($element->ownerDocument));
164 }
165 if ($this->_gphotoUser !== null) {
166 $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument));
167 }
168 if ($this->_gphotoQuotaCurrent !== null) {
169 $element->appendChild($this->_gphotoQuotaCurrent->getDOM($element->ownerDocument));
170 }
171 if ($this->_gphotoQuotaLimit !== null) {
172 $element->appendChild($this->_gphotoQuotaLimit->getDOM($element->ownerDocument));
173 }
174 if ($this->_gphotoMaxPhotosPerAlbum !== null) {
175 $element->appendChild($this->_gphotoMaxPhotosPerAlbum->getDOM($element->ownerDocument));
176 }
177 return $element;
178 }
179
180 /**
181 * Creates individual Entry objects of the appropriate type and
182 * stores them as members of this entry based upon DOM data.
183 *
184 * @param DOMNode $child The DOMNode to process
185 */
186 protected function takeChildFromDOM($child)
187 {
188 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
189
190 switch ($absoluteNodeName) {
191 case $this->lookupNamespace('gphoto') . ':' . 'nickname';
192 $nickname = new Zend_Gdata_Photos_Extension_Nickname();
193 $nickname->transferFromDOM($child);
194 $this->_gphotoNickname = $nickname;
195 break;
196 case $this->lookupNamespace('gphoto') . ':' . 'thumbnail';
197 $thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail();
198 $thumbnail->transferFromDOM($child);
199 $this->_gphotoThumbnail = $thumbnail;
200 break;
201 case $this->lookupNamespace('gphoto') . ':' . 'user';
202 $user = new Zend_Gdata_Photos_Extension_User();
203 $user->transferFromDOM($child);
204 $this->_gphotoUser = $user;
205 break;
206 case $this->lookupNamespace('gphoto') . ':' . 'quotacurrent';
207 $quotaCurrent = new Zend_Gdata_Photos_Extension_QuotaCurrent();
208 $quotaCurrent->transferFromDOM($child);
209 $this->_gphotoQuotaCurrent = $quotaCurrent;
210 break;
211 case $this->lookupNamespace('gphoto') . ':' . 'quotalimit';
212 $quotaLimit = new Zend_Gdata_Photos_Extension_QuotaLimit();
213 $quotaLimit->transferFromDOM($child);
214 $this->_gphotoQuotaLimit = $quotaLimit;
215 break;
216 case $this->lookupNamespace('gphoto') . ':' . 'maxPhotosPerAlbum';
217 $maxPhotosPerAlbum = new Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum();
218 $maxPhotosPerAlbum->transferFromDOM($child);
219 $this->_gphotoMaxPhotosPerAlbum = $maxPhotosPerAlbum;
220 break;
221 default:
222 parent::takeChildFromDOM($child);
223 break;
224 }
225 }
226
227 /**
228 * Get the value for this element's gphoto:nickname attribute.
229 *
230 * @see setGphotoNickname
231 * @return string The requested attribute.
232 */
233 public function getGphotoNickname()
234 {
235 return $this->_gphotoNickname;
236 }
237
238 /**
239 * Set the value for this element's gphoto:nickname attribute.
240 *
241 * @param string $value The desired value for this attribute.
242 * @return Zend_Gdata_Photos_Extension_Nickname The element being modified.
243 */
244 public function setGphotoNickname($value)
245 {
246 $this->_gphotoNickname = $value;
247 return $this;
248 }
249
250 /**
251 * Get the value for this element's gphoto:thumbnail attribute.
252 *
253 * @see setGphotoThumbnail
254 * @return string The requested attribute.
255 */
256 public function getGphotoThumbnail()
257 {
258 return $this->_gphotoThumbnail;
259 }
260
261 /**
262 * Set the value for this element's gphoto:thumbnail attribute.
263 *
264 * @param string $value The desired value for this attribute.
265 * @return Zend_Gdata_Photos_Extension_Thumbnail The element being modified.
266 */
267 public function setGphotoThumbnail($value)
268 {
269 $this->_gphotoThumbnail = $value;
270 return $this;
271 }
272
273 /**
274 * Get the value for this element's gphoto:quotacurrent attribute.
275 *
276 * @see setGphotoQuotaCurrent
277 * @return string The requested attribute.
278 */
279 public function getGphotoQuotaCurrent()
280 {
281 return $this->_gphotoQuotaCurrent;
282 }
283
284 /**
285 * Set the value for this element's gphoto:quotacurrent attribute.
286 *
287 * @param string $value The desired value for this attribute.
288 * @return Zend_Gdata_Photos_Extension_QuotaCurrent The element being modified.
289 */
290 public function setGphotoQuotaCurrent($value)
291 {
292 $this->_gphotoQuotaCurrent = $value;
293 return $this;
294 }
295
296 /**
297 * Get the value for this element's gphoto:quotalimit attribute.
298 *
299 * @see setGphotoQuotaLimit
300 * @return string The requested attribute.
301 */
302 public function getGphotoQuotaLimit()
303 {
304 return $this->_gphotoQuotaLimit;
305 }
306
307 /**
308 * Set the value for this element's gphoto:quotalimit attribute.
309 *
310 * @param string $value The desired value for this attribute.
311 * @return Zend_Gdata_Photos_Extension_QuotaLimit The element being modified.
312 */
313 public function setGphotoQuotaLimit($value)
314 {
315 $this->_gphotoQuotaLimit = $value;
316 return $this;
317 }
318
319 /**
320 * Get the value for this element's gphoto:maxPhotosPerAlbum attribute.
321 *
322 * @see setGphotoMaxPhotosPerAlbum
323 * @return string The requested attribute.
324 */
325 public function getGphotoMaxPhotosPerAlbum()
326 {
327 return $this->_gphotoMaxPhotosPerAlbum;
328 }
329
330 /**
331 * Set the value for this element's gphoto:maxPhotosPerAlbum attribute.
332 *
333 * @param string $value The desired value for this attribute.
334 * @return Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum The element being modified.
335 */
336 public function setGphotoMaxPhotosPerAlbum($value)
337 {
338 $this->_gphotoMaxPhotosPerAlbum = $value;
339 return $this;
340 }
341
342 /**
343 * Get the value for this element's gphoto:user attribute.
344 *
345 * @see setGphotoUser
346 * @return string The requested attribute.
347 */
348 public function getGphotoUser()
349 {
350 return $this->_gphotoUser;
351 }
352
353 /**
354 * Set the value for this element's gphoto:user attribute.
355 *
356 * @param string $value The desired value for this attribute.
357 * @return Zend_Gdata_Photos_Extension_User The element being modified.
358 */
359 public function setGphotoUser($value)
360 {
361 $this->_gphotoUser = $value;
362 return $this;
363 }
364
365}
Note: See TracBrowser for help on using the repository browser.