From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- zend/library/Zend/Gdata/Photos/AlbumEntry.php | 610 ++++++++++++++++++ zend/library/Zend/Gdata/Photos/AlbumFeed.php | 509 +++++++++++++++ zend/library/Zend/Gdata/Photos/AlbumQuery.php | 149 +++++ zend/library/Zend/Gdata/Photos/CommentEntry.php | 195 ++++++ .../library/Zend/Gdata/Photos/Extension/Access.php | 63 ++ .../Zend/Gdata/Photos/Extension/AlbumId.php | 63 ++ .../Zend/Gdata/Photos/Extension/BytesUsed.php | 62 ++ .../Zend/Gdata/Photos/Extension/Checksum.php | 63 ++ .../library/Zend/Gdata/Photos/Extension/Client.php | 63 ++ .../Zend/Gdata/Photos/Extension/CommentCount.php | 63 ++ .../Gdata/Photos/Extension/CommentingEnabled.php | 64 ++ .../library/Zend/Gdata/Photos/Extension/Height.php | 62 ++ zend/library/Zend/Gdata/Photos/Extension/Id.php | 62 ++ .../Zend/Gdata/Photos/Extension/Location.php | 62 ++ .../Gdata/Photos/Extension/MaxPhotosPerAlbum.php | 63 ++ zend/library/Zend/Gdata/Photos/Extension/Name.php | 62 ++ .../Zend/Gdata/Photos/Extension/Nickname.php | 62 ++ .../Zend/Gdata/Photos/Extension/NumPhotos.php | 62 ++ .../Gdata/Photos/Extension/NumPhotosRemaining.php | 62 ++ .../Zend/Gdata/Photos/Extension/PhotoId.php | 61 ++ .../Zend/Gdata/Photos/Extension/Position.php | 62 ++ .../Zend/Gdata/Photos/Extension/QuotaCurrent.php | 62 ++ .../Zend/Gdata/Photos/Extension/QuotaLimit.php | 63 ++ .../Zend/Gdata/Photos/Extension/Rotation.php | 63 ++ zend/library/Zend/Gdata/Photos/Extension/Size.php | 62 ++ .../Zend/Gdata/Photos/Extension/Thumbnail.php | 62 ++ .../Zend/Gdata/Photos/Extension/Timestamp.php | 63 ++ zend/library/Zend/Gdata/Photos/Extension/User.php | 62 ++ .../Zend/Gdata/Photos/Extension/Version.php | 63 ++ .../library/Zend/Gdata/Photos/Extension/Weight.php | 63 ++ zend/library/Zend/Gdata/Photos/Extension/Width.php | 62 ++ zend/library/Zend/Gdata/Photos/PhotoEntry.php | 691 +++++++++++++++++++++ zend/library/Zend/Gdata/Photos/PhotoFeed.php | 559 +++++++++++++++++ zend/library/Zend/Gdata/Photos/PhotoQuery.php | 98 +++ zend/library/Zend/Gdata/Photos/TagEntry.php | 140 +++++ zend/library/Zend/Gdata/Photos/UserEntry.php | 366 +++++++++++ zend/library/Zend/Gdata/Photos/UserFeed.php | 247 ++++++++ zend/library/Zend/Gdata/Photos/UserQuery.php | 355 +++++++++++ 38 files changed, 5605 insertions(+) create mode 100755 zend/library/Zend/Gdata/Photos/AlbumEntry.php create mode 100755 zend/library/Zend/Gdata/Photos/AlbumFeed.php create mode 100755 zend/library/Zend/Gdata/Photos/AlbumQuery.php create mode 100755 zend/library/Zend/Gdata/Photos/CommentEntry.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Access.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/AlbumId.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/BytesUsed.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Checksum.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Client.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/CommentCount.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/CommentingEnabled.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Height.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Id.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Location.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/MaxPhotosPerAlbum.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Name.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Nickname.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/NumPhotos.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/NumPhotosRemaining.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/PhotoId.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Position.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/QuotaCurrent.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/QuotaLimit.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Rotation.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Size.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Thumbnail.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Timestamp.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/User.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Version.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Weight.php create mode 100755 zend/library/Zend/Gdata/Photos/Extension/Width.php create mode 100755 zend/library/Zend/Gdata/Photos/PhotoEntry.php create mode 100755 zend/library/Zend/Gdata/Photos/PhotoFeed.php create mode 100755 zend/library/Zend/Gdata/Photos/PhotoQuery.php create mode 100755 zend/library/Zend/Gdata/Photos/TagEntry.php create mode 100755 zend/library/Zend/Gdata/Photos/UserEntry.php create mode 100755 zend/library/Zend/Gdata/Photos/UserFeed.php create mode 100755 zend/library/Zend/Gdata/Photos/UserQuery.php (limited to 'zend/library/Zend/Gdata/Photos') diff --git a/zend/library/Zend/Gdata/Photos/AlbumEntry.php b/zend/library/Zend/Gdata/Photos/AlbumEntry.php new file mode 100755 index 0000000..03c0b83 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/AlbumEntry.php @@ -0,0 +1,610 @@ + in the Google Data protocol. + * + * @category Zend + * @package Zend_Gdata + * @subpackage Photos + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Gdata_Photos_AlbumEntry extends Zend_Gdata_Entry +{ + + protected $_entryClassName = 'Zend_Gdata_Photos_AlbumEntry'; + + /** + * gphoto:id element + * + * @var Zend_Gdata_Photos_Extension_Id + */ + protected $_gphotoId = null; + + /** + * gphoto:access element + * + * @var Zend_Gdata_Photos_Extension_Access + */ + protected $_gphotoAccess = null; + + /** + * gphoto:location element + * + * @var Zend_Gdata_Photos_Extension_Location + */ + protected $_gphotoLocation = null; + + /** + * gphoto:user element + * + * @var Zend_Gdata_Photos_Extension_User + */ + protected $_gphotoUser = null; + + /** + * gphoto:nickname element + * + * @var Zend_Gdata_Photos_Extension_Nickname + */ + protected $_gphotoNickname = null; + + /** + * gphoto:timestamp element + * + * @var Zend_Gdata_Photos_Extension_Timestamp + */ + protected $_gphotoTimestamp = null; + + /** + * gphoto:name element + * + * @var Zend_Gdata_Photos_Extension_Name + */ + protected $_gphotoName = null; + + /** + * gphoto:numphotos element + * + * @var Zend_Gdata_Photos_Extension_NumPhotos + */ + protected $_gphotoNumPhotos = null; + + /** + * gphoto:commentCount element + * + * @var Zend_Gdata_Photos_Extension_CommentCount + */ + protected $_gphotoCommentCount = null; + + /** + * gphoto:commentingEnabled element + * + * @var Zend_Gdata_Photos_Extension_CommentingEnabled + */ + protected $_gphotoCommentingEnabled = null; + + /** + * media:group element + * + * @var Zend_Gdata_Media_MediaGroup + */ + protected $_mediaGroup = null; + + /** + * georss:where element + * + * @var Zend_Gdata_Geo_Extension_GeoRssWhere + */ + protected $_geoRssWhere = null; + + /** + * Create a new instance. + * + * @param DOMElement $element (optional) DOMElement from which this + * object should be constructed. + */ + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + + $category = new Zend_Gdata_App_Extension_Category( + 'http://schemas.google.com/photos/2007#album', + 'http://schemas.google.com/g/2005#kind'); + $this->setCategory(array($category)); + } + + /** + * Retrieves a DOMElement which corresponds to this element and all + * child properties. This is used to build an entry back into a DOM + * and eventually XML text for application storage/persistence. + * + * @param DOMDocument $doc The DOMDocument used to construct DOMElements + * @return DOMElement The DOMElement representing this element and all + * child properties. + */ + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoTimestamp !== null) { + $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument)); + } + if ($this->_gphotoUser !== null) { + $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument)); + } + if ($this->_gphotoNickname !== null) { + $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument)); + } + if ($this->_gphotoAccess !== null) { + $element->appendChild($this->_gphotoAccess->getDOM($element->ownerDocument)); + } + if ($this->_gphotoLocation !== null) { + $element->appendChild($this->_gphotoLocation->getDOM($element->ownerDocument)); + } + if ($this->_gphotoName !== null) { + $element->appendChild($this->_gphotoName->getDOM($element->ownerDocument)); + } + if ($this->_gphotoNumPhotos !== null) { + $element->appendChild($this->_gphotoNumPhotos->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentCount !== null) { + $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentingEnabled !== null) { + $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument)); + } + if ($this->_gphotoId !== null) { + $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); + } + if ($this->_mediaGroup !== null) { + $element->appendChild($this->_mediaGroup->getDOM($element->ownerDocument)); + } + return $element; + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them as members of this entry based upon DOM data. + * + * @param DOMNode $child The DOMNode to process + */ + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'access'; + $access = new Zend_Gdata_Photos_Extension_Access(); + $access->transferFromDOM($child); + $this->_gphotoAccess = $access; + break; + case $this->lookupNamespace('gphoto') . ':' . 'location'; + $location = new Zend_Gdata_Photos_Extension_Location(); + $location->transferFromDOM($child); + $this->_gphotoLocation = $location; + break; + case $this->lookupNamespace('gphoto') . ':' . 'name'; + $name = new Zend_Gdata_Photos_Extension_Name(); + $name->transferFromDOM($child); + $this->_gphotoName = $name; + break; + case $this->lookupNamespace('gphoto') . ':' . 'numphotos'; + $numPhotos = new Zend_Gdata_Photos_Extension_NumPhotos(); + $numPhotos->transferFromDOM($child); + $this->_gphotoNumPhotos = $numPhotos; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentCount'; + $commentCount = new Zend_Gdata_Photos_Extension_CommentCount(); + $commentCount->transferFromDOM($child); + $this->_gphotoCommentCount = $commentCount; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled'; + $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled(); + $commentingEnabled->transferFromDOM($child); + $this->_gphotoCommentingEnabled = $commentingEnabled; + break; + case $this->lookupNamespace('gphoto') . ':' . 'id'; + $id = new Zend_Gdata_Photos_Extension_Id(); + $id->transferFromDOM($child); + $this->_gphotoId = $id; + break; + case $this->lookupNamespace('gphoto') . ':' . 'user'; + $user = new Zend_Gdata_Photos_Extension_User(); + $user->transferFromDOM($child); + $this->_gphotoUser = $user; + break; + case $this->lookupNamespace('gphoto') . ':' . 'timestamp'; + $timestamp = new Zend_Gdata_Photos_Extension_Timestamp(); + $timestamp->transferFromDOM($child); + $this->_gphotoTimestamp = $timestamp; + break; + case $this->lookupNamespace('gphoto') . ':' . 'nickname'; + $nickname = new Zend_Gdata_Photos_Extension_Nickname(); + $nickname->transferFromDOM($child); + $this->_gphotoNickname = $nickname; + break; + case $this->lookupNamespace('georss') . ':' . 'where'; + $geoRssWhere = new Zend_Gdata_Geo_Extension_GeoRssWhere(); + $geoRssWhere->transferFromDOM($child); + $this->_geoRssWhere = $geoRssWhere; + break; + case $this->lookupNamespace('media') . ':' . 'group'; + $mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup(); + $mediaGroup->transferFromDOM($child); + $this->_mediaGroup = $mediaGroup; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Get the value for this element's gphoto:access attribute. + * + * @see setGphotoAccess + * @return string The requested attribute. + */ + public function getGphotoAccess() + { + return $this->_gphotoAccess; + } + + /** + * Set the value for this element's gphoto:access attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Access The element being modified. + */ + public function setGphotoAccess($value) + { + $this->_gphotoAccess = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:location attribute. + * + * @see setGphotoLocation + * @return string The requested attribute. + */ + public function getGphotoLocation() + { + return $this->_gphotoLocation; + } + + /** + * Set the value for this element's gphoto:location attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Location The element being modified. + */ + public function setGphotoLocation($value) + { + $this->_location = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:name attribute. + * + * @see setGphotoName + * @return string The requested attribute. + */ + public function getGphotoName() + { + return $this->_gphotoName; + } + + /** + * Set the value for this element's gphoto:name attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Name The element being modified. + */ + public function setGphotoName($value) + { + $this->_gphotoName = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:numphotos attribute. + * + * @see setGphotoNumPhotos + * @return string The requested attribute. + */ + public function getGphotoNumPhotos() + { + return $this->_gphotoNumPhotos; + } + + /** + * Set the value for this element's gphoto:numphotos attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_NumPhotos The element being modified. + */ + public function setGphotoNumPhotos($value) + { + $this->_gphotoNumPhotos = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentCount attribute. + * + * @see setGphotoCommentCount + * @return string The requested attribute. + */ + public function getGphotoCommentCount() + { + return $this->_gphotoCommentCount; + } + + /** + * Set the value for this element's gphoto:commentCount attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified. + */ + public function setGphotoCommentCount($value) + { + $this->_gphotoCommentCount = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentingEnabled attribute. + * + * @see setGphotoCommentingEnabled + * @return string The requested attribute. + */ + public function getGphotoCommentingEnabled() + { + return $this->_gphotoCommentingEnabled; + } + + /** + * Set the value for this element's gphoto:commentingEnabled attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified. + */ + public function setGphotoCommentingEnabled($value) + { + $this->_gphotoCommentingEnabled = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:id attribute. + * + * @see setGphotoId + * @return string The requested attribute. + */ + public function getGphotoId() + { + return $this->_gphotoId; + } + + /** + * Set the value for this element's gphoto:id attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Id The element being modified. + */ + public function setGphotoId($value) + { + $this->_gphotoId = $value; + return $this; + } + + /** + * Get the value for this element's georss:where attribute. + * + * @see setGeoRssWhere + * @return string The requested attribute. + */ + public function getGeoRssWhere() + { + return $this->_geoRssWhere; + } + + /** + * Set the value for this element's georss:where attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Geo_Extension_GeoRssWhere The element being modified. + */ + public function setGeoRssWhere($value) + { + $this->_geoRssWhere = $value; + return $this; + } + + /** + * Get the value for this element's media:group attribute. + * + * @see setMediaGroup + * @return string The requested attribute. + */ + public function getMediaGroup() + { + return $this->_mediaGroup; + } + + /** + * Set the value for this element's media:group attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Media_Extension_MediaGroup The element being modified. + */ + public function setMediaGroup($value) + { + $this->_mediaGroup = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:user attribute. + * + * @see setGphotoUser + * @return string The requested attribute. + */ + public function getGphotoUser() + { + return $this->_gphotoUser; + } + + /** + * Set the value for this element's gphoto:user attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_User The element being modified. + */ + public function setGphotoUser($value) + { + $this->_gphotoUser = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:nickname attribute. + * + * @see setGphotoNickname + * @return string The requested attribute. + */ + public function getGphotoNickname() + { + return $this->_gphotoNickname; + } + + /** + * Set the value for this element's gphoto:nickname attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Nickname The element being modified. + */ + public function setGphotoNickname($value) + { + $this->_gphotoNickname = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:timestamp attribute. + * + * @see setGphotoTimestamp + * @return string The requested attribute. + */ + public function getGphotoTimestamp() + { + return $this->_gphotoTimestamp; + } + + /** + * Set the value for this element's gphoto:timestamp attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified. + */ + public function setGphotoTimestamp($value) + { + $this->_gphotoTimestamp = $value; + return $this; + } +} diff --git a/zend/library/Zend/Gdata/Photos/AlbumFeed.php b/zend/library/Zend/Gdata/Photos/AlbumFeed.php new file mode 100755 index 0000000..a4b7cfb --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/AlbumFeed.php @@ -0,0 +1,509 @@ + 'Zend_Gdata_Photos_PhotoEntry', + 'http://schemas.google.com/photos/2007#comment' => 'Zend_Gdata_Photos_CommentEntry', + 'http://schemas.google.com/photos/2007#tag' => 'Zend_Gdata_Photos_TagEntry' + ); + + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + } + + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoId != null) { + $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); + } + if ($this->_gphotoUser != null) { + $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument)); + } + if ($this->_gphotoNickname != null) { + $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument)); + } + if ($this->_gphotoName != null) { + $element->appendChild($this->_gphotoName->getDOM($element->ownerDocument)); + } + if ($this->_gphotoLocation != null) { + $element->appendChild($this->_gphotoLocation->getDOM($element->ownerDocument)); + } + if ($this->_gphotoAccess != null) { + $element->appendChild($this->_gphotoAccess->getDOM($element->ownerDocument)); + } + if ($this->_gphotoTimestamp != null) { + $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument)); + } + if ($this->_gphotoNumPhotos != null) { + $element->appendChild($this->_gphotoNumPhotos->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentingEnabled != null) { + $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentCount != null) { + $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument)); + } + + return $element; + } + + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'id'; + $id = new Zend_Gdata_Photos_Extension_Id(); + $id->transferFromDOM($child); + $this->_gphotoId = $id; + break; + case $this->lookupNamespace('gphoto') . ':' . 'user'; + $user = new Zend_Gdata_Photos_Extension_User(); + $user->transferFromDOM($child); + $this->_gphotoUser = $user; + break; + case $this->lookupNamespace('gphoto') . ':' . 'nickname'; + $nickname = new Zend_Gdata_Photos_Extension_Nickname(); + $nickname->transferFromDOM($child); + $this->_gphotoNickname = $nickname; + break; + case $this->lookupNamespace('gphoto') . ':' . 'name'; + $name = new Zend_Gdata_Photos_Extension_Name(); + $name->transferFromDOM($child); + $this->_gphotoName = $name; + break; + case $this->lookupNamespace('gphoto') . ':' . 'location'; + $location = new Zend_Gdata_Photos_Extension_Location(); + $location->transferFromDOM($child); + $this->_gphotoLocation = $location; + break; + case $this->lookupNamespace('gphoto') . ':' . 'access'; + $access = new Zend_Gdata_Photos_Extension_Access(); + $access->transferFromDOM($child); + $this->_gphotoAccess = $access; + break; + case $this->lookupNamespace('gphoto') . ':' . 'timestamp'; + $timestamp = new Zend_Gdata_Photos_Extension_Timestamp(); + $timestamp->transferFromDOM($child); + $this->_gphotoTimestamp = $timestamp; + break; + case $this->lookupNamespace('gphoto') . ':' . 'numphotos'; + $numphotos = new Zend_Gdata_Photos_Extension_NumPhotos(); + $numphotos->transferFromDOM($child); + $this->_gphotoNumPhotos = $numphotos; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled'; + $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled(); + $commentingEnabled->transferFromDOM($child); + $this->_gphotoCommentingEnabled = $commentingEnabled; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentCount'; + $commentCount = new Zend_Gdata_Photos_Extension_CommentCount(); + $commentCount->transferFromDOM($child); + $this->_gphotoCommentCount = $commentCount; + break; + case $this->lookupNamespace('atom') . ':' . 'entry': + $entryClassName = $this->_entryClassName; + $tmpEntry = new Zend_Gdata_App_Entry($child); + $categories = $tmpEntry->getCategory(); + foreach ($categories as $category) { + if ($category->scheme == Zend_Gdata_Photos::KIND_PATH && + $this->_entryKindClassMapping[$category->term] != "") { + $entryClassName = $this->_entryKindClassMapping[$category->term]; + break; + } else { + require_once 'Zend/Gdata/App/Exception.php'; + throw new Zend_Gdata_App_Exception('Entry is missing kind declaration.'); + } + } + + $newEntry = new $entryClassName($child); + $newEntry->setHttpClient($this->getHttpClient()); + $this->_entry[] = $newEntry; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Get the value for this element's gphoto:user attribute. + * + * @see setGphotoUser + * @return string The requested attribute. + */ + public function getGphotoUser() + { + return $this->_gphotoUser; + } + + /** + * Set the value for this element's gphoto:user attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_User The element being modified. + */ + public function setGphotoUser($value) + { + $this->_gphotoUser = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:access attribute. + * + * @see setGphotoAccess + * @return string The requested attribute. + */ + public function getGphotoAccess() + { + return $this->_gphotoAccess; + } + + /** + * Set the value for this element's gphoto:access attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Access The element being modified. + */ + public function setGphotoAccess($value) + { + $this->_gphotoAccess = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:location attribute. + * + * @see setGphotoLocation + * @return string The requested attribute. + */ + public function getGphotoLocation() + { + return $this->_gphotoLocation; + } + + /** + * Set the value for this element's gphoto:location attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Location The element being modified. + */ + public function setGphotoLocation($value) + { + $this->_gphotoLocation = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:name attribute. + * + * @see setGphotoName + * @return string The requested attribute. + */ + public function getGphotoName() + { + return $this->_gphotoName; + } + + /** + * Set the value for this element's gphoto:name attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Name The element being modified. + */ + public function setGphotoName($value) + { + $this->_gphotoName = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:numphotos attribute. + * + * @see setGphotoNumPhotos + * @return string The requested attribute. + */ + public function getGphotoNumPhotos() + { + return $this->_gphotoNumPhotos; + } + + /** + * Set the value for this element's gphoto:numphotos attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_NumPhotos The element being modified. + */ + public function setGphotoNumPhotos($value) + { + $this->_gphotoNumPhotos = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentCount attribute. + * + * @see setGphotoCommentCount + * @return string The requested attribute. + */ + public function getGphotoCommentCount() + { + return $this->_gphotoCommentCount; + } + + /** + * Set the value for this element's gphoto:commentCount attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified. + */ + public function setGphotoCommentCount($value) + { + $this->_gphotoCommentCount = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentingEnabled attribute. + * + * @see setGphotoCommentingEnabled + * @return string The requested attribute. + */ + public function getGphotoCommentingEnabled() + { + return $this->_gphotoCommentingEnabled; + } + + /** + * Set the value for this element's gphoto:commentingEnabled attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified. + */ + public function setGphotoCommentingEnabled($value) + { + $this->_gphotoCommentingEnabled = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:id attribute. + * + * @see setGphotoId + * @return string The requested attribute. + */ + public function getGphotoId() + { + return $this->_gphotoId; + } + + /** + * Set the value for this element's gphoto:id attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Id The element being modified. + */ + public function setGphotoId($value) + { + $this->_gphotoId = $value; + return $this; + } + + /** + * Get the value for this element's georss:where attribute. + * + * @see setGeoRssWhere + * @return string The requested attribute. + */ + public function getGeoRssWhere() + { + return $this->_geoRssWhere; + } + + /** + * Set the value for this element's georss:where attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Geo_Extension_GeoRssWhere The element being modified. + */ + public function setGeoRssWhere($value) + { + $this->_geoRssWhere = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:nickname attribute. + * + * @see setGphotoNickname + * @return string The requested attribute. + */ + public function getGphotoNickname() + { + return $this->_gphotoNickname; + } + + /** + * Set the value for this element's gphoto:nickname attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Nickname The element being modified. + */ + public function setGphotoNickname($value) + { + $this->_gphotoNickname = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:timestamp attribute. + * + * @see setGphotoTimestamp + * @return string The requested attribute. + */ + public function getGphotoTimestamp() + { + return $this->_gphotoTimestamp; + } + + /** + * Set the value for this element's gphoto:timestamp attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified. + */ + public function setGphotoTimestamp($value) + { + $this->_gphotoTimestamp = $value; + return $this; + } + +} diff --git a/zend/library/Zend/Gdata/Photos/AlbumQuery.php b/zend/library/Zend/Gdata/Photos/AlbumQuery.php new file mode 100755 index 0000000..ee00322 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/AlbumQuery.php @@ -0,0 +1,149 @@ +_albumId = null; + $this->_albumName = $value; + + return $this; + } + + /** + * Get the album name which is to be returned. + * + * @see setAlbumName + * @return string The name of the album to retrieve. + */ + public function getAlbumName() + { + return $this->_albumName; + } + + /** + * Set the album ID to query for. When set, this album's photographs + * be returned. If not set or null, the default user's feed will be + * returned instead. + * + * NOTE: Album and AlbumId are mutually exclusive. Setting one will + * automatically set the other to null. + * + * @param string $value The ID of the album to retrieve, or null to + * clear. + * @return Zend_Gdata_Photos_AlbumQuery The query object. + */ + public function setAlbumId($value) + { + $this->_albumName = null; + $this->_albumId = $value; + + return $this; + } + + /** + * Get the album ID which is to be returned. + * + * @see setAlbum + * @return string The ID of the album to retrieve. + */ + public function getAlbumId() + { + return $this->_albumId; + } + + /** + * Returns the URL generated for this query, based on it's current + * parameters. + * + * @return string A URL generated based on the state of this query. + * @throws Zend_Gdata_App_InvalidArgumentException + */ + public function getQueryUrl($incomingUri = '') + { + $uri = ''; + if ($this->getAlbumName() !== null && $this->getAlbumId() === null) { + $uri .= '/album/' . $this->getAlbumName(); + } elseif ($this->getAlbumName() === null && $this->getAlbumId() !== null) { + $uri .= '/albumid/' . $this->getAlbumId(); + } elseif ($this->getAlbumName() !== null && $this->getAlbumId() !== null) { + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'AlbumName and AlbumId cannot both be non-null'); + } else { + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'AlbumName and AlbumId cannot both be null'); + } + $uri .= $incomingUri; + return parent::getQueryUrl($uri); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/CommentEntry.php b/zend/library/Zend/Gdata/Photos/CommentEntry.php new file mode 100755 index 0000000..24bfae3 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/CommentEntry.php @@ -0,0 +1,195 @@ + in the Google Data protocol. + * + * @category Zend + * @package Zend_Gdata + * @subpackage Photos + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Gdata_Photos_CommentEntry extends Zend_Gdata_Entry +{ + + protected $_entryClassName = 'Zend_Gdata_Photos_CommentEntry'; + + /** + * gphoto:id element + * + * @var Zend_Gdata_Photos_Extension_Id + */ + protected $_gphotoId = null; + + /** + * gphoto:photoid element, differs from gphoto:id as this is an + * actual identification number unique exclusively to photo entries, + * whereas gphoto:id can refer to all gphoto objects + * + * @var Zend_Gdata_Photos_Extension_PhotoId + */ + protected $_gphotoPhotoId = null; + + /** + * Create a new instance. + * + * @param DOMElement $element (optional) DOMElement from which this + * object should be constructed. + */ + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + + $category = new Zend_Gdata_App_Extension_Category( + 'http://schemas.google.com/photos/2007#comment', + 'http://schemas.google.com/g/2005#kind'); + $this->setCategory(array($category)); + } + + /** + * Retrieves a DOMElement which corresponds to this element and all + * child properties. This is used to build an entry back into a DOM + * and eventually XML text for application storage/persistence. + * + * @param DOMDocument $doc The DOMDocument used to construct DOMElements + * @return DOMElement The DOMElement representing this element and all + * child properties. + */ + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoId !== null) { + $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); + } + if ($this->_gphotoPhotoId !== null) { + $element->appendChild($this->_gphotoPhotoId->getDOM($element->ownerDocument)); + } + return $element; + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them as members of this entry based upon DOM data. + * + * @param DOMNode $child The DOMNode to process + */ + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'id'; + $id = new Zend_Gdata_Photos_Extension_Id(); + $id->transferFromDOM($child); + $this->_gphotoId = $id; + break; + case $this->lookupNamespace('gphoto') . ':' . 'photoid'; + $photoid = new Zend_Gdata_Photos_Extension_PhotoId(); + $photoid->transferFromDOM($child); + $this->_gphotoPhotoId = $photoid; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Get the value for this element's gphoto:photoid attribute. + * + * @see setGphotoPhotoId + * @return string The requested attribute. + */ + public function getGphotoPhotoId() + { + return $this->_gphotoPhotoId; + } + + /** + * Set the value for this element's gphoto:photoid attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_PhotoId The element being modified. + */ + public function setGphotoPhotoId($value) + { + $this->_gphotoPhotoId = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:id attribute. + * + * @see setGphotoId + * @return string The requested attribute. + */ + public function getGphotoId() + { + return $this->_gphotoId; + } + + /** + * Set the value for this element's gphoto:id attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Id The element being modified. + */ + public function setGphotoId($value) + { + $this->_gphotoId = $value; + return $this; + } +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Access.php b/zend/library/Zend/Gdata/Photos/Extension/Access.php new file mode 100755 index 0000000..d3040a2 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Access.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/AlbumId.php b/zend/library/Zend/Gdata/Photos/Extension/AlbumId.php new file mode 100755 index 0000000..1efb08b --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/AlbumId.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/BytesUsed.php b/zend/library/Zend/Gdata/Photos/Extension/BytesUsed.php new file mode 100755 index 0000000..14a6e4b --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/BytesUsed.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Checksum.php b/zend/library/Zend/Gdata/Photos/Extension/Checksum.php new file mode 100755 index 0000000..1f252f6 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Checksum.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Client.php b/zend/library/Zend/Gdata/Photos/Extension/Client.php new file mode 100755 index 0000000..72335bf --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Client.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/CommentCount.php b/zend/library/Zend/Gdata/Photos/Extension/CommentCount.php new file mode 100755 index 0000000..d3742ef --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/CommentCount.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/CommentingEnabled.php b/zend/library/Zend/Gdata/Photos/Extension/CommentingEnabled.php new file mode 100755 index 0000000..5440960 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/CommentingEnabled.php @@ -0,0 +1,64 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Height.php b/zend/library/Zend/Gdata/Photos/Extension/Height.php new file mode 100755 index 0000000..ab7ab00 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Height.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Id.php b/zend/library/Zend/Gdata/Photos/Extension/Id.php new file mode 100755 index 0000000..0121643 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Id.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Location.php b/zend/library/Zend/Gdata/Photos/Extension/Location.php new file mode 100755 index 0000000..fa60312 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Location.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/MaxPhotosPerAlbum.php b/zend/library/Zend/Gdata/Photos/Extension/MaxPhotosPerAlbum.php new file mode 100755 index 0000000..1deb2bc --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/MaxPhotosPerAlbum.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Name.php b/zend/library/Zend/Gdata/Photos/Extension/Name.php new file mode 100755 index 0000000..94e30f4 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Name.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Nickname.php b/zend/library/Zend/Gdata/Photos/Extension/Nickname.php new file mode 100755 index 0000000..8d64966 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Nickname.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/NumPhotos.php b/zend/library/Zend/Gdata/Photos/Extension/NumPhotos.php new file mode 100755 index 0000000..ef60301 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/NumPhotos.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/NumPhotosRemaining.php b/zend/library/Zend/Gdata/Photos/Extension/NumPhotosRemaining.php new file mode 100755 index 0000000..6bf42e6 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/NumPhotosRemaining.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/PhotoId.php b/zend/library/Zend/Gdata/Photos/Extension/PhotoId.php new file mode 100755 index 0000000..5c71f39 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/PhotoId.php @@ -0,0 +1,61 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Position.php b/zend/library/Zend/Gdata/Photos/Extension/Position.php new file mode 100755 index 0000000..75e9988 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Position.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/QuotaCurrent.php b/zend/library/Zend/Gdata/Photos/Extension/QuotaCurrent.php new file mode 100755 index 0000000..3caa587 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/QuotaCurrent.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/QuotaLimit.php b/zend/library/Zend/Gdata/Photos/Extension/QuotaLimit.php new file mode 100755 index 0000000..7f074cc --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/QuotaLimit.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Rotation.php b/zend/library/Zend/Gdata/Photos/Extension/Rotation.php new file mode 100755 index 0000000..9d10263 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Rotation.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Size.php b/zend/library/Zend/Gdata/Photos/Extension/Size.php new file mode 100755 index 0000000..932b4b4 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Size.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Thumbnail.php b/zend/library/Zend/Gdata/Photos/Extension/Thumbnail.php new file mode 100755 index 0000000..6512e9f --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Thumbnail.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Timestamp.php b/zend/library/Zend/Gdata/Photos/Extension/Timestamp.php new file mode 100755 index 0000000..48f6302 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Timestamp.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/User.php b/zend/library/Zend/Gdata/Photos/Extension/User.php new file mode 100755 index 0000000..a452a1c --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/User.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Version.php b/zend/library/Zend/Gdata/Photos/Extension/Version.php new file mode 100755 index 0000000..cf759f0 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Version.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Weight.php b/zend/library/Zend/Gdata/Photos/Extension/Weight.php new file mode 100755 index 0000000..7482104 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Weight.php @@ -0,0 +1,63 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/Extension/Width.php b/zend/library/Zend/Gdata/Photos/Extension/Width.php new file mode 100755 index 0000000..e0fd78e --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/Extension/Width.php @@ -0,0 +1,62 @@ +registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct(); + $this->setText($text); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/PhotoEntry.php b/zend/library/Zend/Gdata/Photos/PhotoEntry.php new file mode 100755 index 0000000..ce3165f --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/PhotoEntry.php @@ -0,0 +1,691 @@ + in the Google Data protocol. + * + * @category Zend + * @package Zend_Gdata + * @subpackage Photos + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Gdata_Photos_PhotoEntry extends Zend_Gdata_Media_Entry +{ + + protected $_entryClassName = 'Zend_Gdata_Photos_PhotoEntry'; + + /** + * gphoto:id element + * + * @var Zend_Gdata_Photos_Extension_Id + */ + protected $_gphotoId = null; + + /** + * gphoto:albumid element + * + * @var Zend_Gdata_Photos_Extension_AlbumId + */ + protected $_gphotoAlbumId = null; + + /** + * gphoto:version element + * + * @var Zend_Gdata_Photos_Extension_Version + */ + protected $_gphotoVersion = null; + + /** + * gphoto:width element + * + * @var Zend_Gdata_Photos_Extension_Width + */ + protected $_gphotoWidth = null; + + /** + * gphoto:height element + * + * @var Zend_Gdata_Photos_Extension_Height + */ + protected $_gphotoHeight = null; + + /** + * gphoto:size element + * + * @var Zend_Gdata_Photos_Extension_Size + */ + protected $_gphotoSize = null; + + /** + * gphoto:client element + * + * @var Zend_Gdata_Photos_Extension_Client + */ + protected $_gphotoClient = null; + + /** + * gphoto:checksum element + * + * @var Zend_Gdata_Photos_Extension_Checksum + */ + protected $_gphotoChecksum = null; + + /** + * gphoto:timestamp element + * + * @var Zend_Gdata_Photos_Extension_Timestamp + */ + protected $_gphotoTimestamp = null; + + /** + * gphoto:commentCount element + * + * @var Zend_Gdata_Photos_Extension_CommentCount + */ + protected $_gphotoCommentCount = null; + + /** + * gphoto:commentingEnabled element + * + * @var Zend_Gdata_Photos_Extension_CommentingEnabled + */ + protected $_gphotoCommentingEnabled = null; + + /** + * exif:tags element + * + * @var Zend_Gdata_Exif_Extension_Tags + */ + protected $_exifTags = null; + + /** + * georss:where element + * + * @var Zend_Gdata_Geo_Extension_GeoRssWhere + */ + protected $_geoRssWhere = null; + + /** + * Create a new instance. + * + * @param DOMElement $element (optional) DOMElement from which this + * object should be constructed. + */ + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + + $category = new Zend_Gdata_App_Extension_Category( + 'http://schemas.google.com/photos/2007#photo', + 'http://schemas.google.com/g/2005#kind'); + $this->setCategory(array($category)); + } + + /** + * Retrieves a DOMElement which corresponds to this element and all + * child properties. This is used to build an entry back into a DOM + * and eventually XML text for application storage/persistence. + * + * @param DOMDocument $doc The DOMDocument used to construct DOMElements + * @return DOMElement The DOMElement representing this element and all + * child properties. + */ + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoAlbumId !== null) { + $element->appendChild($this->_gphotoAlbumId->getDOM($element->ownerDocument)); + } + if ($this->_gphotoId !== null) { + $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); + } + if ($this->_gphotoVersion !== null) { + $element->appendChild($this->_gphotoVersion->getDOM($element->ownerDocument)); + } + if ($this->_gphotoWidth !== null) { + $element->appendChild($this->_gphotoWidth->getDOM($element->ownerDocument)); + } + if ($this->_gphotoHeight !== null) { + $element->appendChild($this->_gphotoHeight->getDOM($element->ownerDocument)); + } + if ($this->_gphotoSize !== null) { + $element->appendChild($this->_gphotoSize->getDOM($element->ownerDocument)); + } + if ($this->_gphotoClient !== null) { + $element->appendChild($this->_gphotoClient->getDOM($element->ownerDocument)); + } + if ($this->_gphotoChecksum !== null) { + $element->appendChild($this->_gphotoChecksum->getDOM($element->ownerDocument)); + } + if ($this->_gphotoTimestamp !== null) { + $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentingEnabled !== null) { + $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentCount !== null) { + $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument)); + } + if ($this->_exifTags !== null) { + $element->appendChild($this->_exifTags->getDOM($element->ownerDocument)); + } + if ($this->_geoRssWhere !== null) { + $element->appendChild($this->_geoRssWhere->getDOM($element->ownerDocument)); + } + return $element; + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them as members of this entry based upon DOM data. + * + * @param DOMNode $child The DOMNode to process + */ + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'albumid'; + $albumId = new Zend_Gdata_Photos_Extension_AlbumId(); + $albumId->transferFromDOM($child); + $this->_gphotoAlbumId = $albumId; + break; + case $this->lookupNamespace('gphoto') . ':' . 'id'; + $id = new Zend_Gdata_Photos_Extension_Id(); + $id->transferFromDOM($child); + $this->_gphotoId = $id; + break; + case $this->lookupNamespace('gphoto') . ':' . 'version'; + $version = new Zend_Gdata_Photos_Extension_Version(); + $version->transferFromDOM($child); + $this->_gphotoVersion = $version; + break; + case $this->lookupNamespace('gphoto') . ':' . 'width'; + $width = new Zend_Gdata_Photos_Extension_Width(); + $width->transferFromDOM($child); + $this->_gphotoWidth = $width; + break; + case $this->lookupNamespace('gphoto') . ':' . 'height'; + $height = new Zend_Gdata_Photos_Extension_Height(); + $height->transferFromDOM($child); + $this->_gphotoHeight = $height; + break; + case $this->lookupNamespace('gphoto') . ':' . 'size'; + $size = new Zend_Gdata_Photos_Extension_Size(); + $size->transferFromDOM($child); + $this->_gphotoSize = $size; + break; + case $this->lookupNamespace('gphoto') . ':' . 'client'; + $client = new Zend_Gdata_Photos_Extension_Client(); + $client->transferFromDOM($child); + $this->_gphotoClient = $client; + break; + case $this->lookupNamespace('gphoto') . ':' . 'checksum'; + $checksum = new Zend_Gdata_Photos_Extension_Checksum(); + $checksum->transferFromDOM($child); + $this->_gphotoChecksum = $checksum; + break; + case $this->lookupNamespace('gphoto') . ':' . 'timestamp'; + $timestamp = new Zend_Gdata_Photos_Extension_Timestamp(); + $timestamp->transferFromDOM($child); + $this->_gphotoTimestamp = $timestamp; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled'; + $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled(); + $commentingEnabled->transferFromDOM($child); + $this->_gphotoCommentingEnabled = $commentingEnabled; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentCount'; + $commentCount = new Zend_Gdata_Photos_Extension_CommentCount(); + $commentCount->transferFromDOM($child); + $this->_gphotoCommentCount = $commentCount; + break; + case $this->lookupNamespace('exif') . ':' . 'tags'; + $exifTags = new Zend_Gdata_Exif_Extension_Tags(); + $exifTags->transferFromDOM($child); + $this->_exifTags = $exifTags; + break; + case $this->lookupNamespace('georss') . ':' . 'where'; + $geoRssWhere = new Zend_Gdata_Geo_Extension_GeoRssWhere(); + $geoRssWhere->transferFromDOM($child); + $this->_geoRssWhere = $geoRssWhere; + break; + default: + parent::takeChildFromDOM($child); + break; + + } + } + + /** + * Get the value for this element's gphoto:albumid attribute. + * + * @see setGphotoAlbumId + * @return string The requested attribute. + */ + public function getGphotoAlbumId() + { + return $this->_gphotoAlbumId; + } + + /** + * Set the value for this element's gphoto:albumid attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_AlbumId The element being modified. + */ + public function setGphotoAlbumId($value) + { + $this->_gphotoAlbumId = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:id attribute. + * + * @see setGphotoId + * @return string The requested attribute. + */ + public function getGphotoId() + { + return $this->_gphotoId; + } + + /** + * Set the value for this element's gphoto:id attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Id The element being modified. + */ + public function setGphotoId($value) + { + $this->_gphotoId = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:version attribute. + * + * @see setGphotoVersion + * @return string The requested attribute. + */ + public function getGphotoVersion() + { + return $this->_gphotoVersion; + } + + /** + * Set the value for this element's gphoto:version attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Version The element being modified. + */ + public function setGphotoVersion($value) + { + $this->_gphotoVersion = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:width attribute. + * + * @see setGphotoWidth + * @return string The requested attribute. + */ + public function getGphotoWidth() + { + return $this->_gphotoWidth; + } + + /** + * Set the value for this element's gphoto:width attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Width The element being modified. + */ + public function setGphotoWidth($value) + { + $this->_gphotoWidth = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:height attribute. + * + * @see setGphotoHeight + * @return string The requested attribute. + */ + public function getGphotoHeight() + { + return $this->_gphotoHeight; + } + + /** + * Set the value for this element's gphoto:height attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Height The element being modified. + */ + public function setGphotoHeight($value) + { + $this->_gphotoHeight = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:size attribute. + * + * @see setGphotoSize + * @return string The requested attribute. + */ + public function getGphotoSize() + { + return $this->_gphotoSize; + } + + /** + * Set the value for this element's gphoto:size attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Size The element being modified. + */ + public function setGphotoSize($value) + { + $this->_gphotoSize = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:client attribute. + * + * @see setGphotoClient + * @return string The requested attribute. + */ + public function getGphotoClient() + { + return $this->_gphotoClient; + } + + /** + * Set the value for this element's gphoto:client attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Client The element being modified. + */ + public function setGphotoClient($value) + { + $this->_gphotoClient = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:checksum attribute. + * + * @see setGphotoChecksum + * @return string The requested attribute. + */ + public function getGphotoChecksum() + { + return $this->_gphotoChecksum; + } + + /** + * Set the value for this element's gphoto:checksum attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Checksum The element being modified. + */ + public function setGphotoChecksum($value) + { + $this->_gphotoChecksum = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:timestamp attribute. + * + * @see setGphotoTimestamp + * @return string The requested attribute. + */ + public function getGphotoTimestamp() + { + return $this->_gphotoTimestamp; + } + + /** + * Set the value for this element's gphoto:timestamp attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified. + */ + public function setGphotoTimestamp($value) + { + $this->_gphotoTimestamp = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentCount attribute. + * + * @see setGphotoCommentCount + * @return string The requested attribute. + */ + public function getGphotoCommentCount() + { + return $this->_gphotoCommentCount; + } + + /** + * Set the value for this element's gphoto:commentCount attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified. + */ + public function setGphotoCommentCount($value) + { + $this->_gphotoCommentCount = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentingEnabled attribute. + * + * @see setGphotoCommentingEnabled + * @return string The requested attribute. + */ + public function getGphotoCommentingEnabled() + { + return $this->_gphotoCommentingEnabled; + } + + /** + * Set the value for this element's gphoto:commentingEnabled attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified. + */ + public function setGphotoCommentingEnabled($value) + { + $this->_gphotoCommentingEnabled = $value; + return $this; + } + + /** + * Get the value for this element's exif:tags attribute. + * + * @see setExifTags + * @return string The requested attribute. + */ + public function getExifTags() + { + return $this->_exifTags; + } + + /** + * Set the value for this element's exif:tags attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Exif_Extension_Tags The element being modified. + */ + public function setExifTags($value) + { + $this->_exifTags = $value; + return $this; + } + + /** + * Get the value for this element's georss:where attribute. + * + * @see setGeoRssWhere + * @return string The requested attribute. + */ + public function getGeoRssWhere() + { + return $this->_geoRssWhere; + } + + /** + * Set the value for this element's georss:where attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Geo_Extension_GeoRssWhere The element being modified. + */ + public function setGeoRssWhere($value) + { + $this->_geoRssWhere = $value; + return $this; + } + + /** + * Get the value for this element's media:group attribute. + * + * @see setMediaGroup + * @return string The requested attribute. + */ + public function getMediaGroup() + { + return $this->_mediaGroup; + } + + /** + * Set the value for this element's media:group attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Media_Extension_MediaGroup The element being modified. + */ + public function setMediaGroup($value) + { + $this->_mediaGroup = $value; + return $this; + } + +} diff --git a/zend/library/Zend/Gdata/Photos/PhotoFeed.php b/zend/library/Zend/Gdata/Photos/PhotoFeed.php new file mode 100755 index 0000000..e0ebe0c --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/PhotoFeed.php @@ -0,0 +1,559 @@ + 'Zend_Gdata_Photos_CommentEntry', + 'http://schemas.google.com/photos/2007#tag' => 'Zend_Gdata_Photos_TagEntry' + ); + + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + } + + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoId != null) { + $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); + } + if ($this->_gphotoVersion != null) { + $element->appendChild($this->_gphotoVersion->getDOM($element->ownerDocument)); + } + if ($this->_gphotoWidth != null) { + $element->appendChild($this->_gphotoWidth->getDOM($element->ownerDocument)); + } + if ($this->_gphotoHeight != null) { + $element->appendChild($this->_gphotoHeight->getDOM($element->ownerDocument)); + } + if ($this->_gphotoSize != null) { + $element->appendChild($this->_gphotoSize->getDOM($element->ownerDocument)); + } + if ($this->_gphotoClient != null) { + $element->appendChild($this->_gphotoClient->getDOM($element->ownerDocument)); + } + if ($this->_gphotoChecksum != null) { + $element->appendChild($this->_gphotoChecksum->getDOM($element->ownerDocument)); + } + if ($this->_gphotoTimestamp != null) { + $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentingEnabled != null) { + $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument)); + } + if ($this->_gphotoCommentCount != null) { + $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument)); + } + if ($this->_mediaGroup != null) { + $element->appendChild($this->_mediaGroup->getDOM($element->ownerDocument)); + } + + return $element; + } + + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'id'; + $id = new Zend_Gdata_Photos_Extension_Id(); + $id->transferFromDOM($child); + $this->_gphotoId = $id; + break; + case $this->lookupNamespace('gphoto') . ':' . 'version'; + $version = new Zend_Gdata_Photos_Extension_Version(); + $version->transferFromDOM($child); + $this->_gphotoVersion = $version; + break; + case $this->lookupNamespace('gphoto') . ':' . 'albumid'; + $albumid = new Zend_Gdata_Photos_Extension_AlbumId(); + $albumid->transferFromDOM($child); + $this->_gphotoAlbumId = $albumid; + break; + case $this->lookupNamespace('gphoto') . ':' . 'width'; + $width = new Zend_Gdata_Photos_Extension_Width(); + $width->transferFromDOM($child); + $this->_gphotoWidth = $width; + break; + case $this->lookupNamespace('gphoto') . ':' . 'height'; + $height = new Zend_Gdata_Photos_Extension_Height(); + $height->transferFromDOM($child); + $this->_gphotoHeight = $height; + break; + case $this->lookupNamespace('gphoto') . ':' . 'size'; + $size = new Zend_Gdata_Photos_Extension_Size(); + $size->transferFromDOM($child); + $this->_gphotoSize = $size; + break; + case $this->lookupNamespace('gphoto') . ':' . 'client'; + $client = new Zend_Gdata_Photos_Extension_Client(); + $client->transferFromDOM($child); + $this->_gphotoClient = $client; + break; + case $this->lookupNamespace('gphoto') . ':' . 'checksum'; + $checksum = new Zend_Gdata_Photos_Extension_Checksum(); + $checksum->transferFromDOM($child); + $this->_gphotoChecksum = $checksum; + break; + case $this->lookupNamespace('gphoto') . ':' . 'timestamp'; + $timestamp = new Zend_Gdata_Photos_Extension_Timestamp(); + $timestamp->transferFromDOM($child); + $this->_gphotoTimestamp = $timestamp; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled'; + $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled(); + $commentingEnabled->transferFromDOM($child); + $this->_gphotoCommentingEnabled = $commentingEnabled; + break; + case $this->lookupNamespace('gphoto') . ':' . 'commentCount'; + $commentCount = new Zend_Gdata_Photos_Extension_CommentCount(); + $commentCount->transferFromDOM($child); + $this->_gphotoCommentCount = $commentCount; + break; + case $this->lookupNamespace('media') . ':' . 'group'; + $mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup(); + $mediaGroup->transferFromDOM($child); + $this->_mediaGroup = $mediaGroup; + break; + case $this->lookupNamespace('atom') . ':' . 'entry': + $entryClassName = $this->_entryClassName; + $tmpEntry = new Zend_Gdata_App_Entry($child); + $categories = $tmpEntry->getCategory(); + foreach ($categories as $category) { + if ($category->scheme == Zend_Gdata_Photos::KIND_PATH && + $this->_entryKindClassMapping[$category->term] != "") { + $entryClassName = $this->_entryKindClassMapping[$category->term]; + break; + } else { + require_once 'Zend/Gdata/App/Exception.php'; + throw new Zend_Gdata_App_Exception('Entry is missing kind declaration.'); + } + } + + $newEntry = new $entryClassName($child); + $newEntry->setHttpClient($this->getHttpClient()); + $this->_entry[] = $newEntry; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Get the value for this element's gphoto:id attribute. + * + * @see setGphotoId + * @return string The requested attribute. + */ + public function getGphotoId() + { + return $this->_gphotoId; + } + + /** + * Set the value for this element's gphoto:id attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Id The element being modified. + */ + public function setGphotoId($value) + { + $this->_gphotoId = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:version attribute. + * + * @see setGphotoVersion + * @return string The requested attribute. + */ + public function getGphotoVersion() + { + return $this->_gphotoVersion; + } + + /** + * Set the value for this element's gphoto:version attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Version The element being modified. + */ + public function setGphotoVersion($value) + { + $this->_gphotoVersion = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:albumid attribute. + * + * @see setGphotoAlbumId + * @return string The requested attribute. + */ + public function getGphotoAlbumId() + { + return $this->_gphotoAlbumId; + } + + /** + * Set the value for this element's gphoto:albumid attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_AlbumId The element being modified. + */ + public function setGphotoAlbumId($value) + { + $this->_gphotoAlbumId = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:width attribute. + * + * @see setGphotoWidth + * @return string The requested attribute. + */ + public function getGphotoWidth() + { + return $this->_gphotoWidth; + } + + /** + * Set the value for this element's gphoto:width attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Width The element being modified. + */ + public function setGphotoWidth($value) + { + $this->_gphotoWidth = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:height attribute. + * + * @see setGphotoHeight + * @return string The requested attribute. + */ + public function getGphotoHeight() + { + return $this->_gphotoHeight; + } + + /** + * Set the value for this element's gphoto:height attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Height The element being modified. + */ + public function setGphotoHeight($value) + { + $this->_gphotoHeight = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:size attribute. + * + * @see setGphotoSize + * @return string The requested attribute. + */ + public function getGphotoSize() + { + return $this->_gphotoSize; + } + + /** + * Set the value for this element's gphoto:size attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Size The element being modified. + */ + public function setGphotoSize($value) + { + $this->_gphotoSize = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:client attribute. + * + * @see setGphotoClient + * @return string The requested attribute. + */ + public function getGphotoClient() + { + return $this->_gphotoClient; + } + + /** + * Set the value for this element's gphoto:client attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Client The element being modified. + */ + public function setGphotoClient($value) + { + $this->_gphotoClient = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:checksum attribute. + * + * @see setGphotoChecksum + * @return string The requested attribute. + */ + public function getGphotoChecksum() + { + return $this->_gphotoChecksum; + } + + /** + * Set the value for this element's gphoto:checksum attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Checksum The element being modified. + */ + public function setGphotoChecksum($value) + { + $this->_gphotoChecksum = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:timestamp attribute. + * + * @see setGphotoTimestamp + * @return string The requested attribute. + */ + public function getGphotoTimestamp() + { + return $this->_gphotoTimestamp; + } + + /** + * Set the value for this element's gphoto:timestamp attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Timestamp The element being modified. + */ + public function setGphotoTimestamp($value) + { + $this->_gphotoTimestamp = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentCount attribute. + * + * @see setGphotoCommentCount + * @return string The requested attribute. + */ + public function getGphotoCommentCount() + { + return $this->_gphotoCommentCount; + } + + /** + * Set the value for this element's gphoto:commentCount attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentCount The element being modified. + */ + public function setGphotoCommentCount($value) + { + $this->_gphotoCommentCount = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:commentingEnabled attribute. + * + * @see setGphotoCommentingEnabled + * @return string The requested attribute. + */ + public function getGphotoCommentingEnabled() + { + return $this->_gphotoCommentingEnabled; + } + + /** + * Set the value for this element's gphoto:commentingEnabled attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_CommentingEnabled The element being modified. + */ + public function setGphotoCommentingEnabled($value) + { + $this->_gphotoCommentingEnabled = $value; + return $this; + } + + /** + * Get the value for this element's media:group attribute. + * + * @see setMediaGroup + * @return string The requested attribute. + */ + public function getMediaGroup() + { + return $this->_mediaGroup; + } + + /** + * Set the value for this element's media:group attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Media_Extension_MediaGroup The element being modified. + */ + public function setMediaGroup($value) + { + $this->_mediaGroup = $value; + return $this; + } + +} diff --git a/zend/library/Zend/Gdata/Photos/PhotoQuery.php b/zend/library/Zend/Gdata/Photos/PhotoQuery.php new file mode 100755 index 0000000..881212d --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/PhotoQuery.php @@ -0,0 +1,98 @@ +_photoId = $value; + } + + /** + * Get the photo ID which is to be returned. + * + * @see setPhoto + * @return string The ID of the photo to retrieve. + */ + public function getPhotoId() + { + return $this->_photoId; + } + + /** + * Returns the URL generated for this query, based on it's current + * parameters. + * + * @return string A URL generated based on the state of this query. + * @throws Zend_Gdata_App_InvalidArgumentException + */ + public function getQueryUrl($incomingUri = '') + { + $uri = ''; + if ($this->getPhotoId() !== null) { + $uri .= '/photoid/' . $this->getPhotoId(); + } else { + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'PhotoId cannot be null'); + } + $uri .= $incomingUri; + return parent::getQueryUrl($uri); + } + +} diff --git a/zend/library/Zend/Gdata/Photos/TagEntry.php b/zend/library/Zend/Gdata/Photos/TagEntry.php new file mode 100755 index 0000000..eb03fb2 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/TagEntry.php @@ -0,0 +1,140 @@ + in the Google Data protocol. + * + * @category Zend + * @package Zend_Gdata + * @subpackage Photos + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Gdata_Photos_TagEntry extends Zend_Gdata_Entry +{ + + protected $_entryClassName = 'Zend_Gdata_Photos_TagEntry'; + + protected $_gphotoWeight = null; + + /** + * Create a new instance. + * + * @param DOMElement $element (optional) DOMElement from which this + * object should be constructed. + */ + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + + $category = new Zend_Gdata_App_Extension_Category( + 'http://schemas.google.com/photos/2007#tag', + 'http://schemas.google.com/g/2005#kind'); + $this->setCategory(array($category)); + } + + /** + * Retrieves a DOMElement which corresponds to this element and all + * child properties. This is used to build an entry back into a DOM + * and eventually XML text for application storage/persistence. + * + * @param DOMDocument $doc The DOMDocument used to construct DOMElements + * @return DOMElement The DOMElement representing this element and all + * child properties. + */ + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoWeight !== null) { + $element->appendChild($this->_gphotoWeight->getDOM($element->ownerDocument)); + } + return $element; + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them as members of this entry based upon DOM data. + * + * @param DOMNode $child The DOMNode to process + */ + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'weight'; + $weight = new Zend_Gdata_Photos_Extension_Weight(); + $weight->transferFromDOM($child); + $this->_gphotoWeight = $weight; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Get the value for this element's gphoto:weight attribute. + * + * @see setGphotoWeight + * @return string The requested attribute. + */ + public function getGphotoWeight() + { + return $this->_gphotoWeight; + } + + /** + * Set the value for this element's gphoto:weight attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Weight The element being modified. + */ + public function setGphotoWeight($value) + { + $this->_gphotoWeight = $value; + return $this; + } +} diff --git a/zend/library/Zend/Gdata/Photos/UserEntry.php b/zend/library/Zend/Gdata/Photos/UserEntry.php new file mode 100755 index 0000000..6f488b8 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/UserEntry.php @@ -0,0 +1,366 @@ + in the Google Data protocol. + * + * @category Zend + * @package Zend_Gdata + * @subpackage Photos + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Gdata_Photos_UserEntry extends Zend_Gdata_Entry +{ + + protected $_entryClassName = 'Zend_Gdata_Photos_UserEntry'; + + /** + * gphoto:nickname element + * + * @var Zend_Gdata_Photos_Extension_Nickname + */ + protected $_gphotoNickname = null; + + /** + * gphoto:user element + * + * @var Zend_Gdata_Photos_Extension_User + */ + protected $_gphotoUser = null; + + /** + * gphoto:thumbnail element + * + * @var Zend_Gdata_Photos_Extension_Thumbnail + */ + protected $_gphotoThumbnail = null; + + /** + * gphoto:quotalimit element + * + * @var Zend_Gdata_Photos_Extension_QuotaLimit + */ + protected $_gphotoQuotaLimit = null; + + /** + * gphoto:quotacurrent element + * + * @var Zend_Gdata_Photos_Extension_QuotaCurrent + */ + protected $_gphotoQuotaCurrent = null; + + /** + * gphoto:maxPhotosPerAlbum element + * + * @var Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum + */ + protected $_gphotoMaxPhotosPerAlbum = null; + + /** + * Create a new instance. + * + * @param DOMElement $element (optional) DOMElement from which this + * object should be constructed. + */ + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + + $category = new Zend_Gdata_App_Extension_Category( + 'http://schemas.google.com/photos/2007#user', + 'http://schemas.google.com/g/2005#kind'); + $this->setCategory(array($category)); + } + + /** + * Retrieves a DOMElement which corresponds to this element and all + * child properties. This is used to build an entry back into a DOM + * and eventually XML text for application storage/persistence. + * + * @param DOMDocument $doc The DOMDocument used to construct DOMElements + * @return DOMElement The DOMElement representing this element and all + * child properties. + */ + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoNickname !== null) { + $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument)); + } + if ($this->_gphotoThumbnail !== null) { + $element->appendChild($this->_gphotoThumbnail->getDOM($element->ownerDocument)); + } + if ($this->_gphotoUser !== null) { + $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument)); + } + if ($this->_gphotoQuotaCurrent !== null) { + $element->appendChild($this->_gphotoQuotaCurrent->getDOM($element->ownerDocument)); + } + if ($this->_gphotoQuotaLimit !== null) { + $element->appendChild($this->_gphotoQuotaLimit->getDOM($element->ownerDocument)); + } + if ($this->_gphotoMaxPhotosPerAlbum !== null) { + $element->appendChild($this->_gphotoMaxPhotosPerAlbum->getDOM($element->ownerDocument)); + } + return $element; + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them as members of this entry based upon DOM data. + * + * @param DOMNode $child The DOMNode to process + */ + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'nickname'; + $nickname = new Zend_Gdata_Photos_Extension_Nickname(); + $nickname->transferFromDOM($child); + $this->_gphotoNickname = $nickname; + break; + case $this->lookupNamespace('gphoto') . ':' . 'thumbnail'; + $thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail(); + $thumbnail->transferFromDOM($child); + $this->_gphotoThumbnail = $thumbnail; + break; + case $this->lookupNamespace('gphoto') . ':' . 'user'; + $user = new Zend_Gdata_Photos_Extension_User(); + $user->transferFromDOM($child); + $this->_gphotoUser = $user; + break; + case $this->lookupNamespace('gphoto') . ':' . 'quotacurrent'; + $quotaCurrent = new Zend_Gdata_Photos_Extension_QuotaCurrent(); + $quotaCurrent->transferFromDOM($child); + $this->_gphotoQuotaCurrent = $quotaCurrent; + break; + case $this->lookupNamespace('gphoto') . ':' . 'quotalimit'; + $quotaLimit = new Zend_Gdata_Photos_Extension_QuotaLimit(); + $quotaLimit->transferFromDOM($child); + $this->_gphotoQuotaLimit = $quotaLimit; + break; + case $this->lookupNamespace('gphoto') . ':' . 'maxPhotosPerAlbum'; + $maxPhotosPerAlbum = new Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum(); + $maxPhotosPerAlbum->transferFromDOM($child); + $this->_gphotoMaxPhotosPerAlbum = $maxPhotosPerAlbum; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Get the value for this element's gphoto:nickname attribute. + * + * @see setGphotoNickname + * @return string The requested attribute. + */ + public function getGphotoNickname() + { + return $this->_gphotoNickname; + } + + /** + * Set the value for this element's gphoto:nickname attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Nickname The element being modified. + */ + public function setGphotoNickname($value) + { + $this->_gphotoNickname = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:thumbnail attribute. + * + * @see setGphotoThumbnail + * @return string The requested attribute. + */ + public function getGphotoThumbnail() + { + return $this->_gphotoThumbnail; + } + + /** + * Set the value for this element's gphoto:thumbnail attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Thumbnail The element being modified. + */ + public function setGphotoThumbnail($value) + { + $this->_gphotoThumbnail = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:quotacurrent attribute. + * + * @see setGphotoQuotaCurrent + * @return string The requested attribute. + */ + public function getGphotoQuotaCurrent() + { + return $this->_gphotoQuotaCurrent; + } + + /** + * Set the value for this element's gphoto:quotacurrent attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_QuotaCurrent The element being modified. + */ + public function setGphotoQuotaCurrent($value) + { + $this->_gphotoQuotaCurrent = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:quotalimit attribute. + * + * @see setGphotoQuotaLimit + * @return string The requested attribute. + */ + public function getGphotoQuotaLimit() + { + return $this->_gphotoQuotaLimit; + } + + /** + * Set the value for this element's gphoto:quotalimit attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_QuotaLimit The element being modified. + */ + public function setGphotoQuotaLimit($value) + { + $this->_gphotoQuotaLimit = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:maxPhotosPerAlbum attribute. + * + * @see setGphotoMaxPhotosPerAlbum + * @return string The requested attribute. + */ + public function getGphotoMaxPhotosPerAlbum() + { + return $this->_gphotoMaxPhotosPerAlbum; + } + + /** + * Set the value for this element's gphoto:maxPhotosPerAlbum attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum The element being modified. + */ + public function setGphotoMaxPhotosPerAlbum($value) + { + $this->_gphotoMaxPhotosPerAlbum = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:user attribute. + * + * @see setGphotoUser + * @return string The requested attribute. + */ + public function getGphotoUser() + { + return $this->_gphotoUser; + } + + /** + * Set the value for this element's gphoto:user attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_User The element being modified. + */ + public function setGphotoUser($value) + { + $this->_gphotoUser = $value; + return $this; + } + +} diff --git a/zend/library/Zend/Gdata/Photos/UserFeed.php b/zend/library/Zend/Gdata/Photos/UserFeed.php new file mode 100755 index 0000000..6f1d7d3 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/UserFeed.php @@ -0,0 +1,247 @@ + 'Zend_Gdata_Photos_AlbumEntry', + 'http://schemas.google.com/photos/2007#photo' => 'Zend_Gdata_Photos_PhotoEntry', + 'http://schemas.google.com/photos/2007#comment' => 'Zend_Gdata_Photos_CommentEntry', + 'http://schemas.google.com/photos/2007#tag' => 'Zend_Gdata_Photos_TagEntry' + ); + + public function __construct($element = null) + { + $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); + parent::__construct($element); + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them in the $_entry array based upon DOM data. + * + * @param DOMNode $child The DOMNode to process + */ + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + switch ($absoluteNodeName) { + case $this->lookupNamespace('gphoto') . ':' . 'user'; + $user = new Zend_Gdata_Photos_Extension_User(); + $user->transferFromDOM($child); + $this->_gphotoUser = $user; + break; + case $this->lookupNamespace('gphoto') . ':' . 'nickname'; + $nickname = new Zend_Gdata_Photos_Extension_Nickname(); + $nickname->transferFromDOM($child); + $this->_gphotoNickname = $nickname; + break; + case $this->lookupNamespace('gphoto') . ':' . 'thumbnail'; + $thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail(); + $thumbnail->transferFromDOM($child); + $this->_gphotoThumbnail = $thumbnail; + break; + case $this->lookupNamespace('atom') . ':' . 'entry': + $entryClassName = $this->_entryClassName; + $tmpEntry = new Zend_Gdata_App_Entry($child); + $categories = $tmpEntry->getCategory(); + foreach ($categories as $category) { + if ($category->scheme == Zend_Gdata_Photos::KIND_PATH && + $this->_entryKindClassMapping[$category->term] != "") { + $entryClassName = $this->_entryKindClassMapping[$category->term]; + break; + } else { + require_once 'Zend/Gdata/App/Exception.php'; + throw new Zend_Gdata_App_Exception('Entry is missing kind declaration.'); + } + } + + $newEntry = new $entryClassName($child); + $newEntry->setHttpClient($this->getHttpClient()); + $this->_entry[] = $newEntry; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_gphotoUser != null) { + $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument)); + } + if ($this->_gphotoNickname != null) { + $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument)); + } + if ($this->_gphotoThumbnail != null) { + $element->appendChild($this->_gphotoThumbnail->getDOM($element->ownerDocument)); + } + + return $element; + } + + /** + * Get the value for this element's gphoto:user attribute. + * + * @see setGphotoUser + * @return string The requested attribute. + */ + public function getGphotoUser() + { + return $this->_gphotoUser; + } + + /** + * Set the value for this element's gphoto:user attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_User The element being modified. + */ + public function setGphotoUser($value) + { + $this->_gphotoUser = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:nickname attribute. + * + * @see setGphotoNickname + * @return string The requested attribute. + */ + public function getGphotoNickname() + { + return $this->_gphotoNickname; + } + + /** + * Set the value for this element's gphoto:nickname attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Nickname The element being modified. + */ + public function setGphotoNickname($value) + { + $this->_gphotoNickname = $value; + return $this; + } + + /** + * Get the value for this element's gphoto:thumbnail attribute. + * + * @see setGphotoThumbnail + * @return string The requested attribute. + */ + public function getGphotoThumbnail() + { + return $this->_gphotoThumbnail; + } + + /** + * Set the value for this element's gphoto:thumbnail attribute. + * + * @param string $value The desired value for this attribute. + * @return Zend_Gdata_Photos_Extension_Thumbnail The element being modified. + */ + public function setGphotoThumbnail($value) + { + $this->_gphotoThumbnail = $value; + return $this; + } + +} diff --git a/zend/library/Zend/Gdata/Photos/UserQuery.php b/zend/library/Zend/Gdata/Photos/UserQuery.php new file mode 100755 index 0000000..87d3c77 --- /dev/null +++ b/zend/library/Zend/Gdata/Photos/UserQuery.php @@ -0,0 +1,355 @@ +_projection = $value; + return $this; + } + + /** + * Gets the format of data in returned in Atom feeds. + * + * @see setProjection + * @return string projection + */ + public function getProjection() + { + return $this->_projection; + } + + /** + * Set's the type of data returned in queries. Can be either + * 'feed' or 'entry'. Normally, 'feed' will be desired. Default is 'feed'. + * + * @param string $value + * @return Zend_Gdata_Photos_UserQuery Provides a fluent interface + */ + public function setType($value) + { + $this->_type = $value; + return $this; + } + + /** + * Gets the type of data in returned in queries. + * + * @see setType + * @return string type + */ + public function getType() + { + return $this->_type; + } + + /** + * Set the user to query for. When set, this user's feed will be + * returned. If not set or null, the default user's feed will be returned + * instead. + * + * @param string $value The user to retrieve, or null for the default + * user. + */ + public function setUser($value) + { + if ($value !== null) { + $this->_user = $value; + } else { + $this->_user = Zend_Gdata_Photos::DEFAULT_USER; + } + } + + /** + * Get the user which is to be returned. + * + * @see setUser + * @return string The visibility to retrieve. + */ + public function getUser() + { + return $this->_user; + } + + /** + * Set the visibility filter for entries returned. Only entries which + * match this value will be returned. If null or unset, the default + * value will be used instead. + * + * Valid values are 'all' (default), 'public', and 'private'. + * + * @param string $value The visibility to filter by, or null to use the + * default value. + */ + public function setAccess($value) + { + if ($value !== null) { + $this->_params['access'] = $value; + } else { + unset($this->_params['access']); + } + } + + /** + * Get the visibility filter for entries returned. + * + * @see setAccess + * @return string The visibility to filter by, or null for the default + * user. + */ + public function getAccess() + { + return $this->_params['access']; + } + + /** + * Set the tag for entries that are returned. Only entries which + * match this value will be returned. If null or unset, this filter will + * not be applied. + * + * See http://code.google.com/apis/picasaweb/reference.html#Parameters + * for a list of valid values. + * + * @param string $value The tag to filter by, or null if no + * filter is to be applied. + */ + public function setTag($value) + { + if ($value !== null) { + $this->_params['tag'] = $value; + } else { + unset($this->_params['tag']); + } + } + + /** + * Get the tag filter for entries returned. + * + * @see setTag + * @return string The tag to filter by, or null if no filter + * is to be applied. + */ + public function getTag() + { + return $this->_params['tag']; + } + + /** + * Set the kind of entries that are returned. Only entries which + * match this value will be returned. If null or unset, this filter will + * not be applied. + * + * See http://code.google.com/apis/picasaweb/reference.html#Parameters + * for a list of valid values. + * + * @param string $value The kind to filter by, or null if no + * filter is to be applied. + */ + public function setKind($value) + { + if ($value !== null) { + $this->_params['kind'] = $value; + } else { + unset($this->_params['kind']); + } + } + + /** + * Get the kind of entries to be returned. + * + * @see setKind + * @return string The kind to filter by, or null if no filter + * is to be applied. + */ + public function getKind() + { + return $this->_params['kind']; + } + + /** + * Set the maximum image size for entries returned. Only entries which + * match this value will be returned. If null or unset, this filter will + * not be applied. + * + * See http://code.google.com/apis/picasaweb/reference.html#Parameters + * for a list of valid values. + * + * @param string $value The image size to filter by, or null if no + * filter is to be applied. + */ + public function setImgMax($value) + { + if ($value !== null) { + $this->_params['imgmax'] = $value; + } else { + unset($this->_params['imgmax']); + } + } + + /** + * Get the maximum image size filter for entries returned. + * + * @see setImgMax + * @return string The image size size to filter by, or null if no filter + * is to be applied. + */ + public function getImgMax() + { + return $this->_params['imgmax']; + } + + /** + * Set the thumbnail size filter for entries returned. Only entries which + * match this value will be returned. If null or unset, this filter will + * not be applied. + * + * See http://code.google.com/apis/picasaweb/reference.html#Parameters + * for a list of valid values. + * + * @param string $value The thumbnail size to filter by, or null if no + * filter is to be applied. + */ + public function setThumbsize($value) + { + if ($value !== null) { + $this->_params['thumbsize'] = $value; + } else { + unset($this->_params['thumbsize']); + } + } + + /** + * Get the thumbnail size filter for entries returned. + * + * @see setThumbsize + * @return string The thumbnail size to filter by, or null if no filter + * is to be applied. + */ + public function getThumbsize() + { + return $this->_params['thumbsize']; + } + + /** + * Returns the URL generated for this query, based on it's current + * parameters. + * + * @return string A URL generated based on the state of this query. + * @throws Zend_Gdata_App_InvalidArgumentException + */ + public function getQueryUrl($incomingUri = null) + { + $uri = Zend_Gdata_Photos::PICASA_BASE_URI; + + if ($this->getType() !== null) { + $uri .= '/' . $this->getType(); + } else { + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'Type must be feed or entry, not null'); + } + + if ($this->getProjection() !== null) { + $uri .= '/' . $this->getProjection(); + } else { + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'Projection must not be null'); + } + + if ($this->getUser() !== null) { + $uri .= '/user/' . $this->getUser(); + } else { + // Should never occur due to setter behavior + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'User must not be null'); + } + + $uri .= $incomingUri; + $uri .= $this->getQueryString(); + return $uri; + } + +} -- cgit v1.2.3