1 | <?php
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Zend Framework
|
---|
5 | *
|
---|
6 | * LICENSE
|
---|
7 | *
|
---|
8 | * This source file is subject to the new BSD license that is bundled
|
---|
9 | * with this package in the file LICENSE.txt.
|
---|
10 | * It is also available through the world-wide-web at this URL:
|
---|
11 | * http://framework.zend.com/license/new-bsd
|
---|
12 | * If you did not receive a copy of the license and are unable to
|
---|
13 | * obtain it through the world-wide-web, please send an email
|
---|
14 | * to license@zend.com so we can send you a copy immediately.
|
---|
15 | *
|
---|
16 | * @category Zend
|
---|
17 | * @package Zend_Gdata
|
---|
18 | * @subpackage Photos
|
---|
19 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
20 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
21 | */
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * @see Zend_Gdata_Gapps_Picasa_AlbumQuery
|
---|
25 | */
|
---|
26 | require_once('Zend/Gdata/Photos/AlbumQuery.php');
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Assists in constructing queries for comment/tag entries.
|
---|
30 | * Instances of this class can be provided in many places where a URL is
|
---|
31 | * required.
|
---|
32 | *
|
---|
33 | * For information on submitting queries to a server, see the
|
---|
34 | * service class, Zend_Gdata_Photos.
|
---|
35 | *
|
---|
36 | * @category Zend
|
---|
37 | * @package Zend_Gdata
|
---|
38 | * @subpackage Photos
|
---|
39 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
40 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
41 | */
|
---|
42 | class Zend_Gdata_Photos_PhotoQuery extends Zend_Gdata_Photos_AlbumQuery
|
---|
43 | {
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * The ID of the photo to query for.
|
---|
47 | *
|
---|
48 | * @var string
|
---|
49 | */
|
---|
50 | protected $_photoId = null;
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Set the photo ID to query for. When set, this photo's comments/tags
|
---|
54 | * will be returned. If not set or null, the default user's feed will be
|
---|
55 | * returned instead.
|
---|
56 | *
|
---|
57 | * @param string $value The ID of the photo to retrieve, or null to
|
---|
58 | * clear.
|
---|
59 | */
|
---|
60 | public function setPhotoId($value)
|
---|
61 | {
|
---|
62 | $this->_photoId = $value;
|
---|
63 | }
|
---|
64 |
|
---|
65 | /**
|
---|
66 | * Get the photo ID which is to be returned.
|
---|
67 | *
|
---|
68 | * @see setPhoto
|
---|
69 | * @return string The ID of the photo to retrieve.
|
---|
70 | */
|
---|
71 | public function getPhotoId()
|
---|
72 | {
|
---|
73 | return $this->_photoId;
|
---|
74 | }
|
---|
75 |
|
---|
76 | /**
|
---|
77 | * Returns the URL generated for this query, based on it's current
|
---|
78 | * parameters.
|
---|
79 | *
|
---|
80 | * @return string A URL generated based on the state of this query.
|
---|
81 | * @throws Zend_Gdata_App_InvalidArgumentException
|
---|
82 | */
|
---|
83 | public function getQueryUrl($incomingUri = '')
|
---|
84 | {
|
---|
85 | $uri = '';
|
---|
86 | if ($this->getPhotoId() !== null) {
|
---|
87 | $uri .= '/photoid/' . $this->getPhotoId();
|
---|
88 | } else {
|
---|
89 | require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
---|
90 | throw new Zend_Gdata_App_InvalidArgumentException(
|
---|
91 | 'PhotoId cannot be null');
|
---|
92 | }
|
---|
93 | $uri .= $incomingUri;
|
---|
94 | return parent::getQueryUrl($uri);
|
---|
95 | }
|
---|
96 |
|
---|
97 | }
|
---|