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.
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_Photos
27 require_once 'Zend/Gdata/Photos.php';
30 * @see Zend_Gdata_Feed
32 require_once 'Zend/Gdata/Feed.php';
35 * @see Zend_Gdata_Photos_AlbumEntry
37 require_once 'Zend/Gdata/Photos/AlbumEntry.php';
40 * Data model for a collection of album entries, usually
41 * provided by the servers.
43 * For information on requesting this feed from a server, see the
44 * service class, Zend_Gdata_Photos.
49 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
50 * @license http://framework.zend.com/license/new-bsd New BSD License
52 class Zend_Gdata_Photos_AlbumFeed extends Zend_Gdata_Feed
54 protected $_entryClassName = 'Zend_Gdata_Photos_AlbumEntry';
55 protected $_feedClassName = 'Zend_Gdata_Photos_AlbumFeed';
60 * @var Zend_Gdata_Photos_Extension_Id
62 protected $_gphotoId = null;
67 * @var Zend_Gdata_Photos_Extension_User
69 protected $_gphotoUser = null;
72 * gphoto:access element
74 * @var Zend_Gdata_Photos_Extension_Access
76 protected $_gphotoAccess = null;
79 * gphoto:location element
81 * @var Zend_Gdata_Photos_Extension_Location
83 protected $_gphotoLocation = null;
86 * gphoto:nickname element
88 * @var Zend_Gdata_Photos_Extension_Nickname
90 protected $_gphotoNickname = null;
93 * gphoto:timestamp element
95 * @var Zend_Gdata_Photos_Extension_Timestamp
97 protected $_gphotoTimestamp = null;
100 * gphoto:name element
102 * @var Zend_Gdata_Photos_Extension_Name
104 protected $_gphotoName = null;
107 * gphoto:numphotos element
109 * @var Zend_Gdata_Photos_Extension_NumPhotos
111 protected $_gphotoNumPhotos = null;
114 * gphoto:commentCount element
116 * @var Zend_Gdata_Photos_Extension_CommentCount
118 protected $_gphotoCommentCount = null;
121 * gphoto:commentingEnabled element
123 * @var Zend_Gdata_Photos_Extension_CommentingEnabled
125 protected $_gphotoCommentingEnabled = null;
127 protected $_entryKindClassMapping = array(
128 'http://schemas.google.com/photos/2007#photo' => 'Zend_Gdata_Photos_PhotoEntry',
129 'http://schemas.google.com/photos/2007#comment' => 'Zend_Gdata_Photos_CommentEntry',
130 'http://schemas.google.com/photos/2007#tag' => 'Zend_Gdata_Photos_TagEntry'
133 public function __construct($element = null)
135 $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces);
136 parent::__construct($element);
139 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
141 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
142 if ($this->_gphotoId != null) {
143 $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument));
145 if ($this->_gphotoUser != null) {
146 $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument));
148 if ($this->_gphotoNickname != null) {
149 $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument));
151 if ($this->_gphotoName != null) {
152 $element->appendChild($this->_gphotoName->getDOM($element->ownerDocument));
154 if ($this->_gphotoLocation != null) {
155 $element->appendChild($this->_gphotoLocation->getDOM($element->ownerDocument));
157 if ($this->_gphotoAccess != null) {
158 $element->appendChild($this->_gphotoAccess->getDOM($element->ownerDocument));
160 if ($this->_gphotoTimestamp != null) {
161 $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument));
163 if ($this->_gphotoNumPhotos != null) {
164 $element->appendChild($this->_gphotoNumPhotos->getDOM($element->ownerDocument));
166 if ($this->_gphotoCommentingEnabled != null) {
167 $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument));
169 if ($this->_gphotoCommentCount != null) {
170 $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument));
176 protected function takeChildFromDOM($child)
178 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
180 switch ($absoluteNodeName) {
181 case $this->lookupNamespace('gphoto') . ':' . 'id';
182 $id = new Zend_Gdata_Photos_Extension_Id();
183 $id->transferFromDOM($child);
184 $this->_gphotoId = $id;
186 case $this->lookupNamespace('gphoto') . ':' . 'user';
187 $user = new Zend_Gdata_Photos_Extension_User();
188 $user->transferFromDOM($child);
189 $this->_gphotoUser = $user;
191 case $this->lookupNamespace('gphoto') . ':' . 'nickname';
192 $nickname = new Zend_Gdata_Photos_Extension_Nickname();
193 $nickname->transferFromDOM($child);
194 $this->_gphotoNickname = $nickname;
196 case $this->lookupNamespace('gphoto') . ':' . 'name';
197 $name = new Zend_Gdata_Photos_Extension_Name();
198 $name->transferFromDOM($child);
199 $this->_gphotoName = $name;
201 case $this->lookupNamespace('gphoto') . ':' . 'location';
202 $location = new Zend_Gdata_Photos_Extension_Location();
203 $location->transferFromDOM($child);
204 $this->_gphotoLocation = $location;
206 case $this->lookupNamespace('gphoto') . ':' . 'access';
207 $access = new Zend_Gdata_Photos_Extension_Access();
208 $access->transferFromDOM($child);
209 $this->_gphotoAccess = $access;
211 case $this->lookupNamespace('gphoto') . ':' . 'timestamp';
212 $timestamp = new Zend_Gdata_Photos_Extension_Timestamp();
213 $timestamp->transferFromDOM($child);
214 $this->_gphotoTimestamp = $timestamp;
216 case $this->lookupNamespace('gphoto') . ':' . 'numphotos';
217 $numphotos = new Zend_Gdata_Photos_Extension_NumPhotos();
218 $numphotos->transferFromDOM($child);
219 $this->_gphotoNumPhotos = $numphotos;
221 case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled';
222 $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled();
223 $commentingEnabled->transferFromDOM($child);
224 $this->_gphotoCommentingEnabled = $commentingEnabled;
226 case $this->lookupNamespace('gphoto') . ':' . 'commentCount';
227 $commentCount = new Zend_Gdata_Photos_Extension_CommentCount();
228 $commentCount->transferFromDOM($child);
229 $this->_gphotoCommentCount = $commentCount;
231 case $this->lookupNamespace('atom') . ':' . 'entry':
232 $entryClassName = $this->_entryClassName;
233 $tmpEntry = new Zend_Gdata_App_Entry($child);
234 $categories = $tmpEntry->getCategory();
235 foreach ($categories as $category) {
236 if ($category->scheme == Zend_Gdata_Photos::KIND_PATH &&
237 $this->_entryKindClassMapping[$category->term] != "") {
238 $entryClassName = $this->_entryKindClassMapping[$category->term];
241 require_once 'Zend/Gdata/App/Exception.php';
242 throw new Zend_Gdata_App_Exception('Entry is missing kind declaration.');
246 $newEntry = new $entryClassName($child);
247 $newEntry->setHttpClient($this->getHttpClient());
248 $this->_entry[] = $newEntry;
251 parent::takeChildFromDOM($child);
257 * Get the value for this element's gphoto:user attribute.
260 * @return string The requested attribute.
262 public function getGphotoUser()
264 return $this->_gphotoUser;
268 * Set the value for this element's gphoto:user attribute.
270 * @param string $value The desired value for this attribute.
271 * @return Zend_Gdata_Photos_Extension_User The element being modified.
273 public function setGphotoUser($value)
275 $this->_gphotoUser = $value;
280 * Get the value for this element's gphoto:access attribute.
282 * @see setGphotoAccess
283 * @return string The requested attribute.
285 public function getGphotoAccess()
287 return $this->_gphotoAccess;
291 * Set the value for this element's gphoto:access attribute.
293 * @param string $value The desired value for this attribute.
294 * @return Zend_Gdata_Photos_Extension_Access The element being modified.
296 public function setGphotoAccess($value)
298 $this->_gphotoAccess = $value;
303 * Get the value for this element's gphoto:location attribute.
305 * @see setGphotoLocation
306 * @return string The requested attribute.
308 public function getGphotoLocation()
310 return $this->_gphotoLocation;
314 * Set the value for this element's gphoto:location attribute.
316 * @param string $value The desired value for this attribute.
317 * @return Zend_Gdata_Photos_Extension_Location The element being modified.
319 public function setGphotoLocation($value)
321 $this->_gphotoLocation = $value;
326 * Get the value for this element's gphoto:name attribute.
329 * @return string The requested attribute.
331 public function getGphotoName()
333 return $this->_gphotoName;
337 * Set the value for this element's gphoto:name attribute.
339 * @param string $value The desired value for this attribute.
340 * @return Zend_Gdata_Photos_Extension_Name The element being modified.
342 public function setGphotoName($value)
344 $this->_gphotoName = $value;
349 * Get the value for this element's gphoto:numphotos attribute.
351 * @see setGphotoNumPhotos
352 * @return string The requested attribute.
354 public function getGphotoNumPhotos()
356 return $this->_gphotoNumPhotos;
360 * Set the value for this element's gphoto:numphotos attribute.
362 * @param string $value The desired value for this attribute.
363 * @return Zend_Gdata_Photos_Extension_NumPhotos The element being modified.
365 public function setGphotoNumPhotos($value)
367 $this->_gphotoNumPhotos = $value;
372 * Get the value for this element's gphoto:commentCount attribute.
374 * @see setGphotoCommentCount
375 * @return string The requested attribute.
377 public function getGphotoCommentCount()
379 return $this->_gphotoCommentCount;
383 * Set the value for this element's gphoto:commentCount attribute.
385 * @param string $value The desired value for this attribute.
386 * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified.
388 public function setGphotoCommentCount($value)
390 $this->_gphotoCommentCount = $value;
395 * Get the value for this element's gphoto:commentingEnabled attribute.
397 * @see setGphotoCommentingEnabled
398 * @return string The requested attribute.
400 public function getGphotoCommentingEnabled()
402 return $this->_gphotoCommentingEnabled;
406 * Set the value for this element's gphoto:commentingEnabled attribute.
408 * @param string $value The desired value for this attribute.
409 * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified.
411 public function setGphotoCommentingEnabled($value)
413 $this->_gphotoCommentingEnabled = $value;
418 * Get the value for this element's gphoto:id attribute.
421 * @return string The requested attribute.
423 public function getGphotoId()
425 return $this->_gphotoId;
429 * Set the value for this element's gphoto:id attribute.
431 * @param string $value The desired value for this attribute.
432 * @return Zend_Gdata_Photos_Extension_Id The element being modified.
434 public function setGphotoId($value)
436 $this->_gphotoId = $value;
441 * Get the value for this element's georss:where attribute.
443 * @see setGeoRssWhere
444 * @return string The requested attribute.
446 public function getGeoRssWhere()
448 return $this->_geoRssWhere;
452 * Set the value for this element's georss:where attribute.
454 * @param string $value The desired value for this attribute.
455 * @return Zend_Gdata_Geo_Extension_GeoRssWhere The element being modified.
457 public function setGeoRssWhere($value)
459 $this->_geoRssWhere = $value;
464 * Get the value for this element's gphoto:nickname attribute.
466 * @see setGphotoNickname
467 * @return string The requested attribute.
469 public function getGphotoNickname()
471 return $this->_gphotoNickname;
475 * Set the value for this element's gphoto:nickname attribute.
477 * @param string $value The desired value for this attribute.
478 * @return Zend_Gdata_Photos_Extension_Nickname The element being modified.
480 public function setGphotoNickname($value)
482 $this->_gphotoNickname = $value;
487 * Get the value for this element's gphoto:timestamp attribute.
489 * @see setGphotoTimestamp
490 * @return string The requested attribute.
492 public function getGphotoTimestamp()
494 return $this->_gphotoTimestamp;
498 * Set the value for this element's gphoto:timestamp attribute.
500 * @param string $value The desired value for this attribute.
501 * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified.
503 public function setGphotoTimestamp($value)
505 $this->_gphotoTimestamp = $value;