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_MediaEntry
27 require_once 'Zend/Gdata/Media/Entry.php';
30 * @see Zend_Gdata_Photos_Extension_PhotoId
32 require_once 'Zend/Gdata/Photos/Extension/PhotoId.php';
35 * @see Zend_Gdata_Photos_Extension_Version
37 require_once 'Zend/Gdata/Photos/Extension/Version.php';
40 * @see Zend_Gdata_Photos_Extension_AlbumId
42 require_once 'Zend/Gdata/Photos/Extension/AlbumId.php';
45 * @see Zend_Gdata_Photos_Extension_Id
47 require_once 'Zend/Gdata/Photos/Extension/Id.php';
50 * @see Zend_Gdata_Photos_Extension_Width
52 require_once 'Zend/Gdata/Photos/Extension/Width.php';
55 * @see Zend_Gdata_Photos_Extension_Height
57 require_once 'Zend/Gdata/Photos/Extension/Height.php';
60 * @see Zend_Gdata_Photos_Extension_Size
62 require_once 'Zend/Gdata/Photos/Extension/Size.php';
65 * @see Zend_Gdata_Photos_Extension_Client
67 require_once 'Zend/Gdata/Photos/Extension/Client.php';
70 * @see Zend_Gdata_Photos_Extension_Checksum
72 require_once 'Zend/Gdata/Photos/Extension/Checksum.php';
75 * @see Zend_Gdata_Photos_Extension_Timestamp
77 require_once 'Zend/Gdata/Photos/Extension/Timestamp.php';
80 * @see Zend_Gdata_Photos_Extension_CommentingEnabled
82 require_once 'Zend/Gdata/Photos/Extension/CommentingEnabled.php';
85 * @see Zend_Gdata_Photos_Extension_CommentCount
87 require_once 'Zend/Gdata/Photos/Extension/CommentCount.php';
90 * @see Zend_Gdata_Exif_Extension_Tags
92 require_once 'Zend/Gdata/Exif/Extension/Tags.php';
95 * @see Zend_Gdata_Geo_Extension_GeoRssWhere
97 require_once 'Zend/Gdata/Geo/Extension/GeoRssWhere.php';
100 * @see Zend_Gdata_App_Extension_Category
102 require_once 'Zend/Gdata/App/Extension/Category.php';
105 * Data model class for a Comment Entry.
107 * To transfer user entries to and from the servers, including
108 * creating new entries, refer to the service class,
111 * This class represents <atom:entry> in the Google Data protocol.
114 * @package Zend_Gdata
116 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
117 * @license http://framework.zend.com/license/new-bsd New BSD License
119 class Zend_Gdata_Photos_PhotoEntry extends Zend_Gdata_Media_Entry
122 protected $_entryClassName = 'Zend_Gdata_Photos_PhotoEntry';
127 * @var Zend_Gdata_Photos_Extension_Id
129 protected $_gphotoId = null;
132 * gphoto:albumid element
134 * @var Zend_Gdata_Photos_Extension_AlbumId
136 protected $_gphotoAlbumId = null;
139 * gphoto:version element
141 * @var Zend_Gdata_Photos_Extension_Version
143 protected $_gphotoVersion = null;
146 * gphoto:width element
148 * @var Zend_Gdata_Photos_Extension_Width
150 protected $_gphotoWidth = null;
153 * gphoto:height element
155 * @var Zend_Gdata_Photos_Extension_Height
157 protected $_gphotoHeight = null;
160 * gphoto:size element
162 * @var Zend_Gdata_Photos_Extension_Size
164 protected $_gphotoSize = null;
167 * gphoto:client element
169 * @var Zend_Gdata_Photos_Extension_Client
171 protected $_gphotoClient = null;
174 * gphoto:checksum element
176 * @var Zend_Gdata_Photos_Extension_Checksum
178 protected $_gphotoChecksum = null;
181 * gphoto:timestamp element
183 * @var Zend_Gdata_Photos_Extension_Timestamp
185 protected $_gphotoTimestamp = null;
188 * gphoto:commentCount element
190 * @var Zend_Gdata_Photos_Extension_CommentCount
192 protected $_gphotoCommentCount = null;
195 * gphoto:commentingEnabled element
197 * @var Zend_Gdata_Photos_Extension_CommentingEnabled
199 protected $_gphotoCommentingEnabled = null;
204 * @var Zend_Gdata_Exif_Extension_Tags
206 protected $_exifTags = null;
209 * georss:where element
211 * @var Zend_Gdata_Geo_Extension_GeoRssWhere
213 protected $_geoRssWhere = null;
216 * Create a new instance.
218 * @param DOMElement $element (optional) DOMElement from which this
219 * object should be constructed.
221 public function __construct($element = null)
223 $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces);
224 parent::__construct($element);
226 $category = new Zend_Gdata_App_Extension_Category(
227 'http://schemas.google.com/photos/2007#photo',
228 'http://schemas.google.com/g/2005#kind');
229 $this->setCategory(array($category));
233 * Retrieves a DOMElement which corresponds to this element and all
234 * child properties. This is used to build an entry back into a DOM
235 * and eventually XML text for application storage/persistence.
237 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
238 * @return DOMElement The DOMElement representing this element and all
241 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
243 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
244 if ($this->_gphotoAlbumId !== null) {
245 $element->appendChild($this->_gphotoAlbumId->getDOM($element->ownerDocument));
247 if ($this->_gphotoId !== null) {
248 $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument));
250 if ($this->_gphotoVersion !== null) {
251 $element->appendChild($this->_gphotoVersion->getDOM($element->ownerDocument));
253 if ($this->_gphotoWidth !== null) {
254 $element->appendChild($this->_gphotoWidth->getDOM($element->ownerDocument));
256 if ($this->_gphotoHeight !== null) {
257 $element->appendChild($this->_gphotoHeight->getDOM($element->ownerDocument));
259 if ($this->_gphotoSize !== null) {
260 $element->appendChild($this->_gphotoSize->getDOM($element->ownerDocument));
262 if ($this->_gphotoClient !== null) {
263 $element->appendChild($this->_gphotoClient->getDOM($element->ownerDocument));
265 if ($this->_gphotoChecksum !== null) {
266 $element->appendChild($this->_gphotoChecksum->getDOM($element->ownerDocument));
268 if ($this->_gphotoTimestamp !== null) {
269 $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument));
271 if ($this->_gphotoCommentingEnabled !== null) {
272 $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument));
274 if ($this->_gphotoCommentCount !== null) {
275 $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument));
277 if ($this->_exifTags !== null) {
278 $element->appendChild($this->_exifTags->getDOM($element->ownerDocument));
280 if ($this->_geoRssWhere !== null) {
281 $element->appendChild($this->_geoRssWhere->getDOM($element->ownerDocument));
287 * Creates individual Entry objects of the appropriate type and
288 * stores them as members of this entry based upon DOM data.
290 * @param DOMNode $child The DOMNode to process
292 protected function takeChildFromDOM($child)
294 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
296 switch ($absoluteNodeName) {
297 case $this->lookupNamespace('gphoto') . ':' . 'albumid';
298 $albumId = new Zend_Gdata_Photos_Extension_AlbumId();
299 $albumId->transferFromDOM($child);
300 $this->_gphotoAlbumId = $albumId;
302 case $this->lookupNamespace('gphoto') . ':' . 'id';
303 $id = new Zend_Gdata_Photos_Extension_Id();
304 $id->transferFromDOM($child);
305 $this->_gphotoId = $id;
307 case $this->lookupNamespace('gphoto') . ':' . 'version';
308 $version = new Zend_Gdata_Photos_Extension_Version();
309 $version->transferFromDOM($child);
310 $this->_gphotoVersion = $version;
312 case $this->lookupNamespace('gphoto') . ':' . 'width';
313 $width = new Zend_Gdata_Photos_Extension_Width();
314 $width->transferFromDOM($child);
315 $this->_gphotoWidth = $width;
317 case $this->lookupNamespace('gphoto') . ':' . 'height';
318 $height = new Zend_Gdata_Photos_Extension_Height();
319 $height->transferFromDOM($child);
320 $this->_gphotoHeight = $height;
322 case $this->lookupNamespace('gphoto') . ':' . 'size';
323 $size = new Zend_Gdata_Photos_Extension_Size();
324 $size->transferFromDOM($child);
325 $this->_gphotoSize = $size;
327 case $this->lookupNamespace('gphoto') . ':' . 'client';
328 $client = new Zend_Gdata_Photos_Extension_Client();
329 $client->transferFromDOM($child);
330 $this->_gphotoClient = $client;
332 case $this->lookupNamespace('gphoto') . ':' . 'checksum';
333 $checksum = new Zend_Gdata_Photos_Extension_Checksum();
334 $checksum->transferFromDOM($child);
335 $this->_gphotoChecksum = $checksum;
337 case $this->lookupNamespace('gphoto') . ':' . 'timestamp';
338 $timestamp = new Zend_Gdata_Photos_Extension_Timestamp();
339 $timestamp->transferFromDOM($child);
340 $this->_gphotoTimestamp = $timestamp;
342 case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled';
343 $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled();
344 $commentingEnabled->transferFromDOM($child);
345 $this->_gphotoCommentingEnabled = $commentingEnabled;
347 case $this->lookupNamespace('gphoto') . ':' . 'commentCount';
348 $commentCount = new Zend_Gdata_Photos_Extension_CommentCount();
349 $commentCount->transferFromDOM($child);
350 $this->_gphotoCommentCount = $commentCount;
352 case $this->lookupNamespace('exif') . ':' . 'tags';
353 $exifTags = new Zend_Gdata_Exif_Extension_Tags();
354 $exifTags->transferFromDOM($child);
355 $this->_exifTags = $exifTags;
357 case $this->lookupNamespace('georss') . ':' . 'where';
358 $geoRssWhere = new Zend_Gdata_Geo_Extension_GeoRssWhere();
359 $geoRssWhere->transferFromDOM($child);
360 $this->_geoRssWhere = $geoRssWhere;
363 parent::takeChildFromDOM($child);
370 * Get the value for this element's gphoto:albumid attribute.
372 * @see setGphotoAlbumId
373 * @return string The requested attribute.
375 public function getGphotoAlbumId()
377 return $this->_gphotoAlbumId;
381 * Set the value for this element's gphoto:albumid attribute.
383 * @param string $value The desired value for this attribute.
384 * @return Zend_Gdata_Photos_Extension_AlbumId The element being modified.
386 public function setGphotoAlbumId($value)
388 $this->_gphotoAlbumId = $value;
393 * Get the value for this element's gphoto:id attribute.
396 * @return string The requested attribute.
398 public function getGphotoId()
400 return $this->_gphotoId;
404 * Set the value for this element's gphoto:id attribute.
406 * @param string $value The desired value for this attribute.
407 * @return Zend_Gdata_Photos_Extension_Id The element being modified.
409 public function setGphotoId($value)
411 $this->_gphotoId = $value;
416 * Get the value for this element's gphoto:version attribute.
418 * @see setGphotoVersion
419 * @return string The requested attribute.
421 public function getGphotoVersion()
423 return $this->_gphotoVersion;
427 * Set the value for this element's gphoto:version attribute.
429 * @param string $value The desired value for this attribute.
430 * @return Zend_Gdata_Photos_Extension_Version The element being modified.
432 public function setGphotoVersion($value)
434 $this->_gphotoVersion = $value;
439 * Get the value for this element's gphoto:width attribute.
441 * @see setGphotoWidth
442 * @return string The requested attribute.
444 public function getGphotoWidth()
446 return $this->_gphotoWidth;
450 * Set the value for this element's gphoto:width attribute.
452 * @param string $value The desired value for this attribute.
453 * @return Zend_Gdata_Photos_Extension_Width The element being modified.
455 public function setGphotoWidth($value)
457 $this->_gphotoWidth = $value;
462 * Get the value for this element's gphoto:height attribute.
464 * @see setGphotoHeight
465 * @return string The requested attribute.
467 public function getGphotoHeight()
469 return $this->_gphotoHeight;
473 * Set the value for this element's gphoto:height attribute.
475 * @param string $value The desired value for this attribute.
476 * @return Zend_Gdata_Photos_Extension_Height The element being modified.
478 public function setGphotoHeight($value)
480 $this->_gphotoHeight = $value;
485 * Get the value for this element's gphoto:size attribute.
488 * @return string The requested attribute.
490 public function getGphotoSize()
492 return $this->_gphotoSize;
496 * Set the value for this element's gphoto:size attribute.
498 * @param string $value The desired value for this attribute.
499 * @return Zend_Gdata_Photos_Extension_Size The element being modified.
501 public function setGphotoSize($value)
503 $this->_gphotoSize = $value;
508 * Get the value for this element's gphoto:client attribute.
510 * @see setGphotoClient
511 * @return string The requested attribute.
513 public function getGphotoClient()
515 return $this->_gphotoClient;
519 * Set the value for this element's gphoto:client attribute.
521 * @param string $value The desired value for this attribute.
522 * @return Zend_Gdata_Photos_Extension_Client The element being modified.
524 public function setGphotoClient($value)
526 $this->_gphotoClient = $value;
531 * Get the value for this element's gphoto:checksum attribute.
533 * @see setGphotoChecksum
534 * @return string The requested attribute.
536 public function getGphotoChecksum()
538 return $this->_gphotoChecksum;
542 * Set the value for this element's gphoto:checksum attribute.
544 * @param string $value The desired value for this attribute.
545 * @return Zend_Gdata_Photos_Extension_Checksum The element being modified.
547 public function setGphotoChecksum($value)
549 $this->_gphotoChecksum = $value;
554 * Get the value for this element's gphoto:timestamp attribute.
556 * @see setGphotoTimestamp
557 * @return string The requested attribute.
559 public function getGphotoTimestamp()
561 return $this->_gphotoTimestamp;
565 * Set the value for this element's gphoto:timestamp attribute.
567 * @param string $value The desired value for this attribute.
568 * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified.
570 public function setGphotoTimestamp($value)
572 $this->_gphotoTimestamp = $value;
577 * Get the value for this element's gphoto:commentCount attribute.
579 * @see setGphotoCommentCount
580 * @return string The requested attribute.
582 public function getGphotoCommentCount()
584 return $this->_gphotoCommentCount;
588 * Set the value for this element's gphoto:commentCount attribute.
590 * @param string $value The desired value for this attribute.
591 * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified.
593 public function setGphotoCommentCount($value)
595 $this->_gphotoCommentCount = $value;
600 * Get the value for this element's gphoto:commentingEnabled attribute.
602 * @see setGphotoCommentingEnabled
603 * @return string The requested attribute.
605 public function getGphotoCommentingEnabled()
607 return $this->_gphotoCommentingEnabled;
611 * Set the value for this element's gphoto:commentingEnabled attribute.
613 * @param string $value The desired value for this attribute.
614 * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified.
616 public function setGphotoCommentingEnabled($value)
618 $this->_gphotoCommentingEnabled = $value;
623 * Get the value for this element's exif:tags attribute.
626 * @return string The requested attribute.
628 public function getExifTags()
630 return $this->_exifTags;
634 * Set the value for this element's exif:tags attribute.
636 * @param string $value The desired value for this attribute.
637 * @return Zend_Gdata_Exif_Extension_Tags The element being modified.
639 public function setExifTags($value)
641 $this->_exifTags = $value;
646 * Get the value for this element's georss:where attribute.
648 * @see setGeoRssWhere
649 * @return string The requested attribute.
651 public function getGeoRssWhere()
653 return $this->_geoRssWhere;
657 * Set the value for this element's georss:where attribute.
659 * @param string $value The desired value for this attribute.
660 * @return Zend_Gdata_Geo_Extension_GeoRssWhere The element being modified.
662 public function setGeoRssWhere($value)
664 $this->_geoRssWhere = $value;
669 * Get the value for this element's media:group attribute.
672 * @return string The requested attribute.
674 public function getMediaGroup()
676 return $this->_mediaGroup;
680 * Set the value for this element's media:group attribute.
682 * @param string $value The desired value for this attribute.
683 * @return Zend_Gdata_Media_Extension_MediaGroup The element being modified.
685 public function setMediaGroup($value)
687 $this->_mediaGroup = $value;