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.
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_Gapps_Query
27 require_once('Zend/Gdata/Gapps/Query.php');
30 * Assists in constructing queries for Google Apps owner entries.
31 * Instances of this class can be provided in many places where a URL is
34 * For information on submitting queries to a server, see the Google Apps
35 * service class, Zend_Gdata_Gapps.
40 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
41 * @license http://framework.zend.com/license/new-bsd New BSD License
43 class Zend_Gdata_Gapps_OwnerQuery extends Zend_Gdata_Gapps_Query
47 * Group owner is refering to
51 protected $_groupId = null;
54 * The email of the owner
58 protected $_ownerEmail = null;
61 * Create a new instance.
63 * @param string $domain (optional) The Google Apps-hosted domain to use
64 * when constructing query URIs.
65 * @param string $groupId (optional) Value for the groupId property.
66 * @param string $ownerEmail (optional) Value for the OwnerEmail property.
68 public function __construct($domain = null, $groupId = null, $ownerEmail = null)
70 parent::__construct($domain);
71 $this->setGroupId($groupId);
72 $this->setOwnerEmail($ownerEmail);
76 * Set the group id to query for.
79 * @param string $value
81 public function setGroupId($value)
83 $this->_groupId = $value;
87 * Get the group id to query for.
92 public function getGroupId()
94 return $this->_groupId;
98 * Set the owner email to query for.
101 * @param string $value
103 public function setOwnerEmail($value)
105 $this->_ownerEmail = $value;
109 * Get the owner email to query for.
114 public function getOwnerEmail()
116 return $this->_ownerEmail;
120 * Returns the query URL generated by this query instance.
122 * @return string The query URL for this instance.
124 public function getQueryUrl()
126 $uri = Zend_Gdata_Gapps::APPS_BASE_FEED_URI;
127 $uri .= Zend_Gdata_Gapps::APPS_GROUP_PATH;
128 $uri .= '/' . $this->_domain;
129 if ($this->_groupId !== null) {
130 $uri .= '/' . $this->_groupId;
132 require_once 'Zend/Gdata/App/InvalidArgumentException.php';
133 throw new Zend_Gdata_App_InvalidArgumentException(
134 'groupId must not be null');
139 if ($this->_ownerEmail !== null) {
140 $uri .= '/' . $this->_ownerEmail;
143 $uri .= $this->getQueryString();