File indexing completed on 2024-12-22 05:36:45

0001 <?php
0002 
0003 /**
0004  * Zend Framework
0005  *
0006  * LICENSE
0007  *
0008  * This source file is subject to the new BSD license that is bundled
0009  * with this package in the file LICENSE.txt.
0010  * It is also available through the world-wide-web at this URL:
0011  * http://framework.zend.com/license/new-bsd
0012  * If you did not receive a copy of the license and are unable to
0013  * obtain it through the world-wide-web, please send an email
0014  * to license@zend.com so we can send you a copy immediately.
0015  *
0016  * @category   Zend
0017  * @package    Zend_Gdata
0018  * @subpackage Photos
0019  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0020  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0021  * @version    $Id$
0022  */
0023 
0024 /**
0025  * @see Zend_Gdata_MediaEntry
0026  */
0027 // require_once 'Zend/Gdata/Media/Entry.php';
0028 
0029 /**
0030  * @see Zend_Gdata_Photos_Extension_PhotoId
0031  */
0032 // require_once 'Zend/Gdata/Photos/Extension/PhotoId.php';
0033 
0034 /**
0035  * @see Zend_Gdata_Photos_Extension_Version
0036  */
0037 // require_once 'Zend/Gdata/Photos/Extension/Version.php';
0038 
0039 /**
0040  * @see Zend_Gdata_Photos_Extension_AlbumId
0041  */
0042 // require_once 'Zend/Gdata/Photos/Extension/AlbumId.php';
0043 
0044 /**
0045  * @see Zend_Gdata_Photos_Extension_Id
0046  */
0047 // require_once 'Zend/Gdata/Photos/Extension/Id.php';
0048 
0049 /**
0050  * @see Zend_Gdata_Photos_Extension_Width
0051  */
0052 // require_once 'Zend/Gdata/Photos/Extension/Width.php';
0053 
0054 /**
0055  * @see Zend_Gdata_Photos_Extension_Height
0056  */
0057 // require_once 'Zend/Gdata/Photos/Extension/Height.php';
0058 
0059 /**
0060  * @see Zend_Gdata_Photos_Extension_Size
0061  */
0062 // require_once 'Zend/Gdata/Photos/Extension/Size.php';
0063 
0064 /**
0065  * @see Zend_Gdata_Photos_Extension_Client
0066  */
0067 // require_once 'Zend/Gdata/Photos/Extension/Client.php';
0068 
0069 /**
0070  * @see Zend_Gdata_Photos_Extension_Checksum
0071  */
0072 // require_once 'Zend/Gdata/Photos/Extension/Checksum.php';
0073 
0074 /**
0075  * @see Zend_Gdata_Photos_Extension_Timestamp
0076  */
0077 // require_once 'Zend/Gdata/Photos/Extension/Timestamp.php';
0078 
0079 /**
0080  * @see Zend_Gdata_Photos_Extension_CommentingEnabled
0081  */
0082 // require_once 'Zend/Gdata/Photos/Extension/CommentingEnabled.php';
0083 
0084 /**
0085  * @see Zend_Gdata_Photos_Extension_CommentCount
0086  */
0087 // require_once 'Zend/Gdata/Photos/Extension/CommentCount.php';
0088 
0089 /**
0090  * @see Zend_Gdata_Exif_Extension_Tags
0091  */
0092 // require_once 'Zend/Gdata/Exif/Extension/Tags.php';
0093 
0094 /**
0095  * @see Zend_Gdata_Geo_Extension_GeoRssWhere
0096  */
0097 // require_once 'Zend/Gdata/Geo/Extension/GeoRssWhere.php';
0098 
0099 /**
0100  * @see Zend_Gdata_App_Extension_Category
0101  */
0102 // require_once 'Zend/Gdata/App/Extension/Category.php';
0103 
0104 /**
0105  * Data model class for a Comment Entry.
0106  *
0107  * To transfer user entries to and from the servers, including
0108  * creating new entries, refer to the service class,
0109  * Zend_Gdata_Photos.
0110  *
0111  * This class represents <atom:entry> in the Google Data protocol.
0112  *
0113  * @category   Zend
0114  * @package    Zend_Gdata
0115  * @subpackage Photos
0116  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0117  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0118  */
0119 class Zend_Gdata_Photos_PhotoEntry extends Zend_Gdata_Media_Entry
0120 {
0121 
0122     protected $_entryClassName = 'Zend_Gdata_Photos_PhotoEntry';
0123 
0124     /**
0125      * gphoto:id element
0126      *
0127      * @var Zend_Gdata_Photos_Extension_Id
0128      */
0129     protected $_gphotoId = null;
0130 
0131     /**
0132      * gphoto:albumid element
0133      *
0134      * @var Zend_Gdata_Photos_Extension_AlbumId
0135      */
0136     protected $_gphotoAlbumId = null;
0137 
0138     /**
0139      * gphoto:version element
0140      *
0141      * @var Zend_Gdata_Photos_Extension_Version
0142      */
0143     protected $_gphotoVersion = null;
0144 
0145     /**
0146      * gphoto:width element
0147      *
0148      * @var Zend_Gdata_Photos_Extension_Width
0149      */
0150     protected $_gphotoWidth = null;
0151 
0152     /**
0153      * gphoto:height element
0154      *
0155      * @var Zend_Gdata_Photos_Extension_Height
0156      */
0157     protected $_gphotoHeight = null;
0158 
0159     /**
0160      * gphoto:size element
0161      *
0162      * @var Zend_Gdata_Photos_Extension_Size
0163      */
0164     protected $_gphotoSize = null;
0165 
0166     /**
0167      * gphoto:client element
0168      *
0169      * @var Zend_Gdata_Photos_Extension_Client
0170      */
0171     protected $_gphotoClient = null;
0172 
0173     /**
0174      * gphoto:checksum element
0175      *
0176      * @var Zend_Gdata_Photos_Extension_Checksum
0177      */
0178     protected $_gphotoChecksum = null;
0179 
0180     /**
0181      * gphoto:timestamp element
0182      *
0183      * @var Zend_Gdata_Photos_Extension_Timestamp
0184      */
0185     protected $_gphotoTimestamp = null;
0186 
0187     /**
0188      * gphoto:commentCount element
0189      *
0190      * @var Zend_Gdata_Photos_Extension_CommentCount
0191      */
0192     protected $_gphotoCommentCount = null;
0193 
0194     /**
0195      * gphoto:commentingEnabled element
0196      *
0197      * @var Zend_Gdata_Photos_Extension_CommentingEnabled
0198      */
0199     protected $_gphotoCommentingEnabled = null;
0200 
0201     /**
0202      * exif:tags element
0203      *
0204      * @var Zend_Gdata_Exif_Extension_Tags
0205      */
0206     protected $_exifTags = null;
0207 
0208     /**
0209      * georss:where element
0210      *
0211      * @var Zend_Gdata_Geo_Extension_GeoRssWhere
0212      */
0213     protected $_geoRssWhere = null;
0214 
0215     /**
0216      * Create a new instance.
0217      *
0218      * @param DOMElement $element (optional) DOMElement from which this
0219      *          object should be constructed.
0220      */
0221     public function __construct($element = null)
0222     {
0223         $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces);
0224         parent::__construct($element);
0225 
0226         $category = new Zend_Gdata_App_Extension_Category(
0227             'http://schemas.google.com/photos/2007#photo',
0228             'http://schemas.google.com/g/2005#kind');
0229         $this->setCategory(array($category));
0230     }
0231 
0232     /**
0233      * Retrieves a DOMElement which corresponds to this element and all
0234      * child properties.  This is used to build an entry back into a DOM
0235      * and eventually XML text for application storage/persistence.
0236      *
0237      * @param DOMDocument $doc The DOMDocument used to construct DOMElements
0238      * @return DOMElement The DOMElement representing this element and all
0239      *          child properties.
0240      */
0241     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
0242     {
0243         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
0244         if ($this->_gphotoAlbumId !== null) {
0245             $element->appendChild($this->_gphotoAlbumId->getDOM($element->ownerDocument));
0246         }
0247         if ($this->_gphotoId !== null) {
0248             $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument));
0249         }
0250         if ($this->_gphotoVersion !== null) {
0251             $element->appendChild($this->_gphotoVersion->getDOM($element->ownerDocument));
0252         }
0253         if ($this->_gphotoWidth !== null) {
0254             $element->appendChild($this->_gphotoWidth->getDOM($element->ownerDocument));
0255         }
0256         if ($this->_gphotoHeight !== null) {
0257             $element->appendChild($this->_gphotoHeight->getDOM($element->ownerDocument));
0258         }
0259         if ($this->_gphotoSize !== null) {
0260             $element->appendChild($this->_gphotoSize->getDOM($element->ownerDocument));
0261         }
0262         if ($this->_gphotoClient !== null) {
0263             $element->appendChild($this->_gphotoClient->getDOM($element->ownerDocument));
0264         }
0265         if ($this->_gphotoChecksum !== null) {
0266             $element->appendChild($this->_gphotoChecksum->getDOM($element->ownerDocument));
0267         }
0268         if ($this->_gphotoTimestamp !== null) {
0269             $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument));
0270         }
0271         if ($this->_gphotoCommentingEnabled !== null) {
0272             $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument));
0273         }
0274         if ($this->_gphotoCommentCount !== null) {
0275             $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument));
0276         }
0277         if ($this->_exifTags !== null) {
0278             $element->appendChild($this->_exifTags->getDOM($element->ownerDocument));
0279         }
0280         if ($this->_geoRssWhere !== null) {
0281             $element->appendChild($this->_geoRssWhere->getDOM($element->ownerDocument));
0282         }
0283         return $element;
0284     }
0285 
0286     /**
0287      * Creates individual Entry objects of the appropriate type and
0288      * stores them as members of this entry based upon DOM data.
0289      *
0290      * @param DOMNode $child The DOMNode to process
0291      */
0292     protected function takeChildFromDOM($child)
0293     {
0294         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
0295 
0296         switch ($absoluteNodeName) {
0297             case $this->lookupNamespace('gphoto') . ':' . 'albumid';
0298                 $albumId = new Zend_Gdata_Photos_Extension_AlbumId();
0299                 $albumId->transferFromDOM($child);
0300                 $this->_gphotoAlbumId = $albumId;
0301                 break;
0302             case $this->lookupNamespace('gphoto') . ':' . 'id';
0303                 $id = new Zend_Gdata_Photos_Extension_Id();
0304                 $id->transferFromDOM($child);
0305                 $this->_gphotoId = $id;
0306                 break;
0307             case $this->lookupNamespace('gphoto') . ':' . 'version';
0308                 $version = new Zend_Gdata_Photos_Extension_Version();
0309                 $version->transferFromDOM($child);
0310                 $this->_gphotoVersion = $version;
0311                 break;
0312             case $this->lookupNamespace('gphoto') . ':' . 'width';
0313                 $width = new Zend_Gdata_Photos_Extension_Width();
0314                 $width->transferFromDOM($child);
0315                 $this->_gphotoWidth = $width;
0316                 break;
0317             case $this->lookupNamespace('gphoto') . ':' . 'height';
0318                 $height = new Zend_Gdata_Photos_Extension_Height();
0319                 $height->transferFromDOM($child);
0320                 $this->_gphotoHeight = $height;
0321                 break;
0322             case $this->lookupNamespace('gphoto') . ':' . 'size';
0323                 $size = new Zend_Gdata_Photos_Extension_Size();
0324                 $size->transferFromDOM($child);
0325                 $this->_gphotoSize = $size;
0326                 break;
0327             case $this->lookupNamespace('gphoto') . ':' . 'client';
0328                 $client = new Zend_Gdata_Photos_Extension_Client();
0329                 $client->transferFromDOM($child);
0330                 $this->_gphotoClient = $client;
0331                 break;
0332             case $this->lookupNamespace('gphoto') . ':' . 'checksum';
0333                 $checksum = new Zend_Gdata_Photos_Extension_Checksum();
0334                 $checksum->transferFromDOM($child);
0335                 $this->_gphotoChecksum = $checksum;
0336                 break;
0337             case $this->lookupNamespace('gphoto') . ':' . 'timestamp';
0338                 $timestamp = new Zend_Gdata_Photos_Extension_Timestamp();
0339                 $timestamp->transferFromDOM($child);
0340                 $this->_gphotoTimestamp = $timestamp;
0341                 break;
0342             case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled';
0343                 $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled();
0344                 $commentingEnabled->transferFromDOM($child);
0345                 $this->_gphotoCommentingEnabled = $commentingEnabled;
0346                 break;
0347             case $this->lookupNamespace('gphoto') . ':' . 'commentCount';
0348                 $commentCount = new Zend_Gdata_Photos_Extension_CommentCount();
0349                 $commentCount->transferFromDOM($child);
0350                 $this->_gphotoCommentCount = $commentCount;
0351                 break;
0352             case $this->lookupNamespace('exif') . ':' . 'tags';
0353                 $exifTags = new Zend_Gdata_Exif_Extension_Tags();
0354                 $exifTags->transferFromDOM($child);
0355                 $this->_exifTags = $exifTags;
0356                 break;
0357             case $this->lookupNamespace('georss') . ':' . 'where';
0358                 $geoRssWhere = new Zend_Gdata_Geo_Extension_GeoRssWhere();
0359                 $geoRssWhere->transferFromDOM($child);
0360                 $this->_geoRssWhere = $geoRssWhere;
0361                 break;
0362             default:
0363                 parent::takeChildFromDOM($child);
0364                 break;
0365 
0366         }
0367     }
0368 
0369     /**
0370      * Get the value for this element's gphoto:albumid attribute.
0371      *
0372      * @see setGphotoAlbumId
0373      * @return string The requested attribute.
0374      */
0375     public function getGphotoAlbumId()
0376     {
0377         return $this->_gphotoAlbumId;
0378     }
0379 
0380     /**
0381      * Set the value for this element's gphoto:albumid attribute.
0382      *
0383      * @param string $value The desired value for this attribute.
0384      * @return Zend_Gdata_Photos_Extension_AlbumId The element being modified.
0385      */
0386     public function setGphotoAlbumId($value)
0387     {
0388         $this->_gphotoAlbumId = $value;
0389         return $this;
0390     }
0391 
0392     /**
0393      * Get the value for this element's gphoto:id attribute.
0394      *
0395      * @see setGphotoId
0396      * @return string The requested attribute.
0397      */
0398     public function getGphotoId()
0399     {
0400         return $this->_gphotoId;
0401     }
0402 
0403     /**
0404      * Set the value for this element's gphoto:id attribute.
0405      *
0406      * @param string $value The desired value for this attribute.
0407      * @return Zend_Gdata_Photos_Extension_Id The element being modified.
0408      */
0409     public function setGphotoId($value)
0410     {
0411         $this->_gphotoId = $value;
0412         return $this;
0413     }
0414 
0415     /**
0416      * Get the value for this element's gphoto:version attribute.
0417      *
0418      * @see setGphotoVersion
0419      * @return string The requested attribute.
0420      */
0421     public function getGphotoVersion()
0422     {
0423         return $this->_gphotoVersion;
0424     }
0425 
0426     /**
0427      * Set the value for this element's gphoto:version attribute.
0428      *
0429      * @param string $value The desired value for this attribute.
0430      * @return Zend_Gdata_Photos_Extension_Version The element being modified.
0431      */
0432     public function setGphotoVersion($value)
0433     {
0434         $this->_gphotoVersion = $value;
0435         return $this;
0436     }
0437 
0438     /**
0439      * Get the value for this element's gphoto:width attribute.
0440      *
0441      * @see setGphotoWidth
0442      * @return string The requested attribute.
0443      */
0444     public function getGphotoWidth()
0445     {
0446         return $this->_gphotoWidth;
0447     }
0448 
0449     /**
0450      * Set the value for this element's gphoto:width attribute.
0451      *
0452      * @param string $value The desired value for this attribute.
0453      * @return Zend_Gdata_Photos_Extension_Width The element being modified.
0454      */
0455     public function setGphotoWidth($value)
0456     {
0457         $this->_gphotoWidth = $value;
0458         return $this;
0459     }
0460 
0461     /**
0462      * Get the value for this element's gphoto:height attribute.
0463      *
0464      * @see setGphotoHeight
0465      * @return string The requested attribute.
0466      */
0467     public function getGphotoHeight()
0468     {
0469         return $this->_gphotoHeight;
0470     }
0471 
0472     /**
0473      * Set the value for this element's gphoto:height attribute.
0474      *
0475      * @param string $value The desired value for this attribute.
0476      * @return Zend_Gdata_Photos_Extension_Height The element being modified.
0477      */
0478     public function setGphotoHeight($value)
0479     {
0480         $this->_gphotoHeight = $value;
0481         return $this;
0482     }
0483 
0484     /**
0485      * Get the value for this element's gphoto:size attribute.
0486      *
0487      * @see setGphotoSize
0488      * @return string The requested attribute.
0489      */
0490     public function getGphotoSize()
0491     {
0492         return $this->_gphotoSize;
0493     }
0494 
0495     /**
0496      * Set the value for this element's gphoto:size attribute.
0497      *
0498      * @param string $value The desired value for this attribute.
0499      * @return Zend_Gdata_Photos_Extension_Size The element being modified.
0500      */
0501     public function setGphotoSize($value)
0502     {
0503         $this->_gphotoSize = $value;
0504         return $this;
0505     }
0506 
0507     /**
0508      * Get the value for this element's gphoto:client attribute.
0509      *
0510      * @see setGphotoClient
0511      * @return string The requested attribute.
0512      */
0513     public function getGphotoClient()
0514     {
0515         return $this->_gphotoClient;
0516     }
0517 
0518     /**
0519      * Set the value for this element's gphoto:client attribute.
0520      *
0521      * @param string $value The desired value for this attribute.
0522      * @return Zend_Gdata_Photos_Extension_Client The element being modified.
0523      */
0524     public function setGphotoClient($value)
0525     {
0526         $this->_gphotoClient = $value;
0527         return $this;
0528     }
0529 
0530     /**
0531      * Get the value for this element's gphoto:checksum attribute.
0532      *
0533      * @see setGphotoChecksum
0534      * @return string The requested attribute.
0535      */
0536     public function getGphotoChecksum()
0537     {
0538         return $this->_gphotoChecksum;
0539     }
0540 
0541     /**
0542      * Set the value for this element's gphoto:checksum attribute.
0543      *
0544      * @param string $value The desired value for this attribute.
0545      * @return Zend_Gdata_Photos_Extension_Checksum The element being modified.
0546      */
0547     public function setGphotoChecksum($value)
0548     {
0549         $this->_gphotoChecksum = $value;
0550         return $this;
0551     }
0552 
0553     /**
0554      * Get the value for this element's gphoto:timestamp attribute.
0555      *
0556      * @see setGphotoTimestamp
0557      * @return string The requested attribute.
0558      */
0559     public function getGphotoTimestamp()
0560     {
0561         return $this->_gphotoTimestamp;
0562     }
0563 
0564     /**
0565      * Set the value for this element's gphoto:timestamp attribute.
0566      *
0567      * @param string $value The desired value for this attribute.
0568      * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified.
0569      */
0570     public function setGphotoTimestamp($value)
0571     {
0572         $this->_gphotoTimestamp = $value;
0573         return $this;
0574     }
0575 
0576     /**
0577      * Get the value for this element's gphoto:commentCount attribute.
0578      *
0579      * @see setGphotoCommentCount
0580      * @return string The requested attribute.
0581      */
0582     public function getGphotoCommentCount()
0583     {
0584         return $this->_gphotoCommentCount;
0585     }
0586 
0587     /**
0588      * Set the value for this element's gphoto:commentCount attribute.
0589      *
0590      * @param string $value The desired value for this attribute.
0591      * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified.
0592      */
0593     public function setGphotoCommentCount($value)
0594     {
0595         $this->_gphotoCommentCount = $value;
0596         return $this;
0597     }
0598 
0599     /**
0600      * Get the value for this element's gphoto:commentingEnabled attribute.
0601      *
0602      * @see setGphotoCommentingEnabled
0603      * @return string The requested attribute.
0604      */
0605     public function getGphotoCommentingEnabled()
0606     {
0607         return $this->_gphotoCommentingEnabled;
0608     }
0609 
0610     /**
0611      * Set the value for this element's gphoto:commentingEnabled attribute.
0612      *
0613      * @param string $value The desired value for this attribute.
0614      * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified.
0615      */
0616     public function setGphotoCommentingEnabled($value)
0617     {
0618         $this->_gphotoCommentingEnabled = $value;
0619         return $this;
0620     }
0621 
0622     /**
0623      * Get the value for this element's exif:tags attribute.
0624      *
0625      * @see setExifTags
0626      * @return string The requested attribute.
0627      */
0628     public function getExifTags()
0629     {
0630         return $this->_exifTags;
0631     }
0632 
0633     /**
0634      * Set the value for this element's exif:tags attribute.
0635      *
0636      * @param string $value The desired value for this attribute.
0637      * @return Zend_Gdata_Exif_Extension_Tags The element being modified.
0638      */
0639     public function setExifTags($value)
0640     {
0641         $this->_exifTags = $value;
0642         return $this;
0643     }
0644 
0645     /**
0646      * Get the value for this element's georss:where attribute.
0647      *
0648      * @see setGeoRssWhere
0649      * @return string The requested attribute.
0650      */
0651     public function getGeoRssWhere()
0652     {
0653         return $this->_geoRssWhere;
0654     }
0655 
0656     /**
0657      * Set the value for this element's georss:where attribute.
0658      *
0659      * @param string $value The desired value for this attribute.
0660      * @return Zend_Gdata_Geo_Extension_GeoRssWhere The element being modified.
0661      */
0662     public function setGeoRssWhere($value)
0663     {
0664         $this->_geoRssWhere = $value;
0665         return $this;
0666     }
0667 
0668     /**
0669      * Get the value for this element's media:group attribute.
0670      *
0671      * @see setMediaGroup
0672      * @return string The requested attribute.
0673      */
0674     public function getMediaGroup()
0675     {
0676         return $this->_mediaGroup;
0677     }
0678 
0679     /**
0680      * Set the value for this element's media:group attribute.
0681      *
0682      * @param string $value The desired value for this attribute.
0683      * @return Zend_Gdata_Media_Extension_MediaGroup The element being modified.
0684      */
0685     public function setMediaGroup($value)
0686     {
0687         $this->_mediaGroup = $value;
0688         return $this;
0689     }
0690 
0691 }