File indexing completed on 2024-12-22 05:36:45
0001 <?php 0002 0003 /** 0004 * Zend Framework 0005 * 0006 * LICENSE 0007 * 0008 * This source file is subject to the new BSD license that is bundled 0009 * with this package in the file LICENSE.txt. 0010 * It is also available through the world-wide-web at this URL: 0011 * http://framework.zend.com/license/new-bsd 0012 * If you did not receive a copy of the license and are unable to 0013 * obtain it through the world-wide-web, please send an email 0014 * to license@zend.com so we can send you a copy immediately. 0015 * 0016 * @category Zend 0017 * @package Zend_Gdata 0018 * @subpackage Photos 0019 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0020 * @license http://framework.zend.com/license/new-bsd New BSD License 0021 * @version $Id$ 0022 */ 0023 0024 /** 0025 * @see Zend_Gdata_Gapps_Picasa_AlbumQuery 0026 */ 0027 // require_once('Zend/Gdata/Photos/AlbumQuery.php'); 0028 0029 /** 0030 * Assists in constructing queries for comment/tag entries. 0031 * Instances of this class can be provided in many places where a URL is 0032 * required. 0033 * 0034 * For information on submitting queries to a server, see the 0035 * service class, Zend_Gdata_Photos. 0036 * 0037 * @category Zend 0038 * @package Zend_Gdata 0039 * @subpackage Photos 0040 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0041 * @license http://framework.zend.com/license/new-bsd New BSD License 0042 */ 0043 class Zend_Gdata_Photos_PhotoQuery extends Zend_Gdata_Photos_AlbumQuery 0044 { 0045 0046 /** 0047 * The ID of the photo to query for. 0048 * 0049 * @var string 0050 */ 0051 protected $_photoId = null; 0052 0053 /** 0054 * Set the photo ID to query for. When set, this photo's comments/tags 0055 * will be returned. If not set or null, the default user's feed will be 0056 * returned instead. 0057 * 0058 * @param string $value The ID of the photo to retrieve, or null to 0059 * clear. 0060 */ 0061 public function setPhotoId($value) 0062 { 0063 $this->_photoId = $value; 0064 } 0065 0066 /** 0067 * Get the photo ID which is to be returned. 0068 * 0069 * @see setPhoto 0070 * @return string The ID of the photo to retrieve. 0071 */ 0072 public function getPhotoId() 0073 { 0074 return $this->_photoId; 0075 } 0076 0077 /** 0078 * Returns the URL generated for this query, based on it's current 0079 * parameters. 0080 * 0081 * @return string A URL generated based on the state of this query. 0082 * @throws Zend_Gdata_App_InvalidArgumentException 0083 */ 0084 public function getQueryUrl($incomingUri = '') 0085 { 0086 $uri = ''; 0087 if ($this->getPhotoId() !== null) { 0088 $uri .= '/photoid/' . $this->getPhotoId(); 0089 } else { 0090 // require_once 'Zend/Gdata/App/InvalidArgumentException.php'; 0091 throw new Zend_Gdata_App_InvalidArgumentException( 0092 'PhotoId cannot be null'); 0093 } 0094 $uri .= $incomingUri; 0095 return parent::getQueryUrl($uri); 0096 } 0097 0098 }