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_Entry 0026 */ 0027 // require_once 'Zend/Gdata/Entry.php'; 0028 0029 /** 0030 * @see Zend_Gdata_Photos_Extension_Access 0031 */ 0032 // require_once 'Zend/Gdata/Photos/Extension/Access.php'; 0033 0034 /** 0035 * @see Zend_Gdata_Photos_Extension_BytesUsed 0036 */ 0037 // require_once 'Zend/Gdata/Photos/Extension/BytesUsed.php'; 0038 0039 /** 0040 * @see Zend_Gdata_Photos_Extension_Location 0041 */ 0042 // require_once 'Zend/Gdata/Photos/Extension/Location.php'; 0043 0044 /** 0045 * @see Zend_Gdata_Photos_Extension_Name 0046 */ 0047 // require_once 'Zend/Gdata/Photos/Extension/Name.php'; 0048 0049 /** 0050 * @see Zend_Gdata_Photos_Extension_NumPhotos 0051 */ 0052 // require_once 'Zend/Gdata/Photos/Extension/NumPhotos.php'; 0053 0054 /** 0055 * @see Zend_Gdata_Photos_Extension_NumPhotosRemaining 0056 */ 0057 // require_once 'Zend/Gdata/Photos/Extension/NumPhotosRemaining.php'; 0058 0059 /** 0060 * @see Zend_Gdata_Photos_Extension_CommentCount 0061 */ 0062 // require_once 'Zend/Gdata/Photos/Extension/CommentCount.php'; 0063 0064 /** 0065 * @see Zend_Gdata_Photos_Extension_CommentingEnabled 0066 */ 0067 // require_once 'Zend/Gdata/Photos/Extension/CommentingEnabled.php'; 0068 0069 /** 0070 * @see Zend_Gdata_Photos_Extension_Id 0071 */ 0072 // require_once 'Zend/Gdata/Photos/Extension/Id.php'; 0073 0074 /** 0075 * @see Zend_Gdata_Geo_Extension_GeoRssWhere 0076 */ 0077 // require_once 'Zend/Gdata/Geo/Extension/GeoRssWhere.php'; 0078 0079 /** 0080 * @see Zend_Gdata_Media_Extension_MediaGroup 0081 */ 0082 // require_once 'Zend/Gdata/Media/Extension/MediaGroup.php'; 0083 0084 /** 0085 * @see Zend_Gdata_App_Extension_Category 0086 */ 0087 // require_once 'Zend/Gdata/App/Extension/Category.php'; 0088 0089 /** 0090 * Data model class for a Photo Album Entry. 0091 * 0092 * To transfer user entries to and from the servers, including 0093 * creating new entries, refer to the service class, 0094 * Zend_Gdata_Photos. 0095 * 0096 * This class represents <atom:entry> in the Google Data protocol. 0097 * 0098 * @category Zend 0099 * @package Zend_Gdata 0100 * @subpackage Photos 0101 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0102 * @license http://framework.zend.com/license/new-bsd New BSD License 0103 */ 0104 class Zend_Gdata_Photos_AlbumEntry extends Zend_Gdata_Entry 0105 { 0106 0107 protected $_entryClassName = 'Zend_Gdata_Photos_AlbumEntry'; 0108 0109 /** 0110 * gphoto:id element 0111 * 0112 * @var Zend_Gdata_Photos_Extension_Id 0113 */ 0114 protected $_gphotoId = null; 0115 0116 /** 0117 * gphoto:access element 0118 * 0119 * @var Zend_Gdata_Photos_Extension_Access 0120 */ 0121 protected $_gphotoAccess = null; 0122 0123 /** 0124 * gphoto:location element 0125 * 0126 * @var Zend_Gdata_Photos_Extension_Location 0127 */ 0128 protected $_gphotoLocation = null; 0129 0130 /** 0131 * gphoto:user element 0132 * 0133 * @var Zend_Gdata_Photos_Extension_User 0134 */ 0135 protected $_gphotoUser = null; 0136 0137 /** 0138 * gphoto:nickname element 0139 * 0140 * @var Zend_Gdata_Photos_Extension_Nickname 0141 */ 0142 protected $_gphotoNickname = null; 0143 0144 /** 0145 * gphoto:timestamp element 0146 * 0147 * @var Zend_Gdata_Photos_Extension_Timestamp 0148 */ 0149 protected $_gphotoTimestamp = null; 0150 0151 /** 0152 * gphoto:name element 0153 * 0154 * @var Zend_Gdata_Photos_Extension_Name 0155 */ 0156 protected $_gphotoName = null; 0157 0158 /** 0159 * gphoto:numphotos element 0160 * 0161 * @var Zend_Gdata_Photos_Extension_NumPhotos 0162 */ 0163 protected $_gphotoNumPhotos = null; 0164 0165 /** 0166 * gphoto:commentCount element 0167 * 0168 * @var Zend_Gdata_Photos_Extension_CommentCount 0169 */ 0170 protected $_gphotoCommentCount = null; 0171 0172 /** 0173 * gphoto:commentingEnabled element 0174 * 0175 * @var Zend_Gdata_Photos_Extension_CommentingEnabled 0176 */ 0177 protected $_gphotoCommentingEnabled = null; 0178 0179 /** 0180 * media:group element 0181 * 0182 * @var Zend_Gdata_Media_MediaGroup 0183 */ 0184 protected $_mediaGroup = null; 0185 0186 /** 0187 * georss:where element 0188 * 0189 * @var Zend_Gdata_Geo_Extension_GeoRssWhere 0190 */ 0191 protected $_geoRssWhere = null; 0192 0193 /** 0194 * Create a new instance. 0195 * 0196 * @param DOMElement $element (optional) DOMElement from which this 0197 * object should be constructed. 0198 */ 0199 public function __construct($element = null) 0200 { 0201 $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); 0202 parent::__construct($element); 0203 0204 $category = new Zend_Gdata_App_Extension_Category( 0205 'http://schemas.google.com/photos/2007#album', 0206 'http://schemas.google.com/g/2005#kind'); 0207 $this->setCategory(array($category)); 0208 } 0209 0210 /** 0211 * Retrieves a DOMElement which corresponds to this element and all 0212 * child properties. This is used to build an entry back into a DOM 0213 * and eventually XML text for application storage/persistence. 0214 * 0215 * @param DOMDocument $doc The DOMDocument used to construct DOMElements 0216 * @return DOMElement The DOMElement representing this element and all 0217 * child properties. 0218 */ 0219 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 0220 { 0221 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 0222 if ($this->_gphotoTimestamp !== null) { 0223 $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument)); 0224 } 0225 if ($this->_gphotoUser !== null) { 0226 $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument)); 0227 } 0228 if ($this->_gphotoNickname !== null) { 0229 $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument)); 0230 } 0231 if ($this->_gphotoAccess !== null) { 0232 $element->appendChild($this->_gphotoAccess->getDOM($element->ownerDocument)); 0233 } 0234 if ($this->_gphotoLocation !== null) { 0235 $element->appendChild($this->_gphotoLocation->getDOM($element->ownerDocument)); 0236 } 0237 if ($this->_gphotoName !== null) { 0238 $element->appendChild($this->_gphotoName->getDOM($element->ownerDocument)); 0239 } 0240 if ($this->_gphotoNumPhotos !== null) { 0241 $element->appendChild($this->_gphotoNumPhotos->getDOM($element->ownerDocument)); 0242 } 0243 if ($this->_gphotoCommentCount !== null) { 0244 $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument)); 0245 } 0246 if ($this->_gphotoCommentingEnabled !== null) { 0247 $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument)); 0248 } 0249 if ($this->_gphotoId !== null) { 0250 $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); 0251 } 0252 if ($this->_mediaGroup !== null) { 0253 $element->appendChild($this->_mediaGroup->getDOM($element->ownerDocument)); 0254 } 0255 return $element; 0256 } 0257 0258 /** 0259 * Creates individual Entry objects of the appropriate type and 0260 * stores them as members of this entry based upon DOM data. 0261 * 0262 * @param DOMNode $child The DOMNode to process 0263 */ 0264 protected function takeChildFromDOM($child) 0265 { 0266 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 0267 0268 switch ($absoluteNodeName) { 0269 case $this->lookupNamespace('gphoto') . ':' . 'access'; 0270 $access = new Zend_Gdata_Photos_Extension_Access(); 0271 $access->transferFromDOM($child); 0272 $this->_gphotoAccess = $access; 0273 break; 0274 case $this->lookupNamespace('gphoto') . ':' . 'location'; 0275 $location = new Zend_Gdata_Photos_Extension_Location(); 0276 $location->transferFromDOM($child); 0277 $this->_gphotoLocation = $location; 0278 break; 0279 case $this->lookupNamespace('gphoto') . ':' . 'name'; 0280 $name = new Zend_Gdata_Photos_Extension_Name(); 0281 $name->transferFromDOM($child); 0282 $this->_gphotoName = $name; 0283 break; 0284 case $this->lookupNamespace('gphoto') . ':' . 'numphotos'; 0285 $numPhotos = new Zend_Gdata_Photos_Extension_NumPhotos(); 0286 $numPhotos->transferFromDOM($child); 0287 $this->_gphotoNumPhotos = $numPhotos; 0288 break; 0289 case $this->lookupNamespace('gphoto') . ':' . 'commentCount'; 0290 $commentCount = new Zend_Gdata_Photos_Extension_CommentCount(); 0291 $commentCount->transferFromDOM($child); 0292 $this->_gphotoCommentCount = $commentCount; 0293 break; 0294 case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled'; 0295 $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled(); 0296 $commentingEnabled->transferFromDOM($child); 0297 $this->_gphotoCommentingEnabled = $commentingEnabled; 0298 break; 0299 case $this->lookupNamespace('gphoto') . ':' . 'id'; 0300 $id = new Zend_Gdata_Photos_Extension_Id(); 0301 $id->transferFromDOM($child); 0302 $this->_gphotoId = $id; 0303 break; 0304 case $this->lookupNamespace('gphoto') . ':' . 'user'; 0305 $user = new Zend_Gdata_Photos_Extension_User(); 0306 $user->transferFromDOM($child); 0307 $this->_gphotoUser = $user; 0308 break; 0309 case $this->lookupNamespace('gphoto') . ':' . 'timestamp'; 0310 $timestamp = new Zend_Gdata_Photos_Extension_Timestamp(); 0311 $timestamp->transferFromDOM($child); 0312 $this->_gphotoTimestamp = $timestamp; 0313 break; 0314 case $this->lookupNamespace('gphoto') . ':' . 'nickname'; 0315 $nickname = new Zend_Gdata_Photos_Extension_Nickname(); 0316 $nickname->transferFromDOM($child); 0317 $this->_gphotoNickname = $nickname; 0318 break; 0319 case $this->lookupNamespace('georss') . ':' . 'where'; 0320 $geoRssWhere = new Zend_Gdata_Geo_Extension_GeoRssWhere(); 0321 $geoRssWhere->transferFromDOM($child); 0322 $this->_geoRssWhere = $geoRssWhere; 0323 break; 0324 case $this->lookupNamespace('media') . ':' . 'group'; 0325 $mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup(); 0326 $mediaGroup->transferFromDOM($child); 0327 $this->_mediaGroup = $mediaGroup; 0328 break; 0329 default: 0330 parent::takeChildFromDOM($child); 0331 break; 0332 } 0333 } 0334 0335 /** 0336 * Get the value for this element's gphoto:access attribute. 0337 * 0338 * @see setGphotoAccess 0339 * @return string The requested attribute. 0340 */ 0341 public function getGphotoAccess() 0342 { 0343 return $this->_gphotoAccess; 0344 } 0345 0346 /** 0347 * Set the value for this element's gphoto:access attribute. 0348 * 0349 * @param string $value The desired value for this attribute. 0350 * @return Zend_Gdata_Photos_Extension_Access The element being modified. 0351 */ 0352 public function setGphotoAccess($value) 0353 { 0354 $this->_gphotoAccess = $value; 0355 return $this; 0356 } 0357 0358 /** 0359 * Get the value for this element's gphoto:location attribute. 0360 * 0361 * @see setGphotoLocation 0362 * @return string The requested attribute. 0363 */ 0364 public function getGphotoLocation() 0365 { 0366 return $this->_gphotoLocation; 0367 } 0368 0369 /** 0370 * Set the value for this element's gphoto:location attribute. 0371 * 0372 * @param string $value The desired value for this attribute. 0373 * @return Zend_Gdata_Photos_Extension_Location The element being modified. 0374 */ 0375 public function setGphotoLocation($value) 0376 { 0377 $this->_location = $value; 0378 return $this; 0379 } 0380 0381 /** 0382 * Get the value for this element's gphoto:name attribute. 0383 * 0384 * @see setGphotoName 0385 * @return string The requested attribute. 0386 */ 0387 public function getGphotoName() 0388 { 0389 return $this->_gphotoName; 0390 } 0391 0392 /** 0393 * Set the value for this element's gphoto:name attribute. 0394 * 0395 * @param string $value The desired value for this attribute. 0396 * @return Zend_Gdata_Photos_Extension_Name The element being modified. 0397 */ 0398 public function setGphotoName($value) 0399 { 0400 $this->_gphotoName = $value; 0401 return $this; 0402 } 0403 0404 /** 0405 * Get the value for this element's gphoto:numphotos attribute. 0406 * 0407 * @see setGphotoNumPhotos 0408 * @return string The requested attribute. 0409 */ 0410 public function getGphotoNumPhotos() 0411 { 0412 return $this->_gphotoNumPhotos; 0413 } 0414 0415 /** 0416 * Set the value for this element's gphoto:numphotos attribute. 0417 * 0418 * @param string $value The desired value for this attribute. 0419 * @return Zend_Gdata_Photos_Extension_NumPhotos The element being modified. 0420 */ 0421 public function setGphotoNumPhotos($value) 0422 { 0423 $this->_gphotoNumPhotos = $value; 0424 return $this; 0425 } 0426 0427 /** 0428 * Get the value for this element's gphoto:commentCount attribute. 0429 * 0430 * @see setGphotoCommentCount 0431 * @return string The requested attribute. 0432 */ 0433 public function getGphotoCommentCount() 0434 { 0435 return $this->_gphotoCommentCount; 0436 } 0437 0438 /** 0439 * Set the value for this element's gphoto:commentCount attribute. 0440 * 0441 * @param string $value The desired value for this attribute. 0442 * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified. 0443 */ 0444 public function setGphotoCommentCount($value) 0445 { 0446 $this->_gphotoCommentCount = $value; 0447 return $this; 0448 } 0449 0450 /** 0451 * Get the value for this element's gphoto:commentingEnabled attribute. 0452 * 0453 * @see setGphotoCommentingEnabled 0454 * @return string The requested attribute. 0455 */ 0456 public function getGphotoCommentingEnabled() 0457 { 0458 return $this->_gphotoCommentingEnabled; 0459 } 0460 0461 /** 0462 * Set the value for this element's gphoto:commentingEnabled attribute. 0463 * 0464 * @param string $value The desired value for this attribute. 0465 * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified. 0466 */ 0467 public function setGphotoCommentingEnabled($value) 0468 { 0469 $this->_gphotoCommentingEnabled = $value; 0470 return $this; 0471 } 0472 0473 /** 0474 * Get the value for this element's gphoto:id attribute. 0475 * 0476 * @see setGphotoId 0477 * @return string The requested attribute. 0478 */ 0479 public function getGphotoId() 0480 { 0481 return $this->_gphotoId; 0482 } 0483 0484 /** 0485 * Set the value for this element's gphoto:id attribute. 0486 * 0487 * @param string $value The desired value for this attribute. 0488 * @return Zend_Gdata_Photos_Extension_Id The element being modified. 0489 */ 0490 public function setGphotoId($value) 0491 { 0492 $this->_gphotoId = $value; 0493 return $this; 0494 } 0495 0496 /** 0497 * Get the value for this element's georss:where attribute. 0498 * 0499 * @see setGeoRssWhere 0500 * @return string The requested attribute. 0501 */ 0502 public function getGeoRssWhere() 0503 { 0504 return $this->_geoRssWhere; 0505 } 0506 0507 /** 0508 * Set the value for this element's georss:where attribute. 0509 * 0510 * @param string $value The desired value for this attribute. 0511 * @return Zend_Gdata_Geo_Extension_GeoRssWhere The element being modified. 0512 */ 0513 public function setGeoRssWhere($value) 0514 { 0515 $this->_geoRssWhere = $value; 0516 return $this; 0517 } 0518 0519 /** 0520 * Get the value for this element's media:group attribute. 0521 * 0522 * @see setMediaGroup 0523 * @return string The requested attribute. 0524 */ 0525 public function getMediaGroup() 0526 { 0527 return $this->_mediaGroup; 0528 } 0529 0530 /** 0531 * Set the value for this element's media:group attribute. 0532 * 0533 * @param string $value The desired value for this attribute. 0534 * @return Zend_Gdata_Media_Extension_MediaGroup The element being modified. 0535 */ 0536 public function setMediaGroup($value) 0537 { 0538 $this->_mediaGroup = $value; 0539 return $this; 0540 } 0541 0542 /** 0543 * Get the value for this element's gphoto:user attribute. 0544 * 0545 * @see setGphotoUser 0546 * @return string The requested attribute. 0547 */ 0548 public function getGphotoUser() 0549 { 0550 return $this->_gphotoUser; 0551 } 0552 0553 /** 0554 * Set the value for this element's gphoto:user attribute. 0555 * 0556 * @param string $value The desired value for this attribute. 0557 * @return Zend_Gdata_Photos_Extension_User The element being modified. 0558 */ 0559 public function setGphotoUser($value) 0560 { 0561 $this->_gphotoUser = $value; 0562 return $this; 0563 } 0564 0565 /** 0566 * Get the value for this element's gphoto:nickname attribute. 0567 * 0568 * @see setGphotoNickname 0569 * @return string The requested attribute. 0570 */ 0571 public function getGphotoNickname() 0572 { 0573 return $this->_gphotoNickname; 0574 } 0575 0576 /** 0577 * Set the value for this element's gphoto:nickname attribute. 0578 * 0579 * @param string $value The desired value for this attribute. 0580 * @return Zend_Gdata_Photos_Extension_Nickname The element being modified. 0581 */ 0582 public function setGphotoNickname($value) 0583 { 0584 $this->_gphotoNickname = $value; 0585 return $this; 0586 } 0587 0588 /** 0589 * Get the value for this element's gphoto:timestamp attribute. 0590 * 0591 * @see setGphotoTimestamp 0592 * @return string The requested attribute. 0593 */ 0594 public function getGphotoTimestamp() 0595 { 0596 return $this->_gphotoTimestamp; 0597 } 0598 0599 /** 0600 * Set the value for this element's gphoto:timestamp attribute. 0601 * 0602 * @param string $value The desired value for this attribute. 0603 * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified. 0604 */ 0605 public function setGphotoTimestamp($value) 0606 { 0607 $this->_gphotoTimestamp = $value; 0608 return $this; 0609 } 0610 }