Gdata/Gapps.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to
[email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Gdata
- Subpackage
- Gapps
- Version
- $Id$
Package: Zend_Gdata\GappsService class for interacting with the Google Apps Provisioning API.
Like other service classes in this module, this class provides access via
an HTTP client to Google servers for working with entries and feeds.
Because of the nature of this API, all access must occur over an
authenticated connection.
- Parent(s)
- \Zend_Gdata
<
\Zend_Gdata_App
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Link
- http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_reference.html
Constants
Properties
string $_domain = null
The domain which is being administered via the Provisioning API.
Default valuenull
Details- Type
- string
array $namespaces = array(array('apps', 'http://schemas.google.com/apps/2006', 1, 0))
staticNamespaces used for Zend_Gdata_Gapps
Default valuearray(array('apps', 'http://schemas.google.com/apps/2006', 1, 0))
Details- Type
- array
Methods
__call(string $method, array $args) : void
Provides a magic factory method to instantiate new objects with
shorter syntax than would otherwise be required by the Zend Framework
naming conventions. For more information, see Zend_Gdata_App::__call().
This overrides the default behavior of __call() so that query classes
do not need to have their domain manually set when created with
a magic factory method.
ParametersName | Type | Description |
---|
$method | string | The method name being called |
---|
$args | array | The arguments passed to the call |
---|
ThrowsDetails- See
-
__construct(\Zend_Http_Client $client = null, string $domain = null, string $applicationId = 'MyCompany-MyApp-1.0') : void
Create Gdata_Gapps object
ParametersName | Type | Description |
---|
$client | \Zend_Http_Client | (optional) The HTTP client to use when
when communicating with the Google Apps servers.
|
---|
$domain | string | (optional) The Google Apps domain which is to be
accessed.
|
---|
$applicationId | string | The identity of the app in the form of Company-AppName-Version |
---|
addMemberToGroup(string $recipientAddress, string $groupId) : \Zend_Gdata_Gapps_MemberEntry
Add an email address to a group as a member
ParametersName | Type | Description |
---|
$recipientAddress | string | Email address, member id, or group id |
---|
$groupId | string | The unique id of the group |
---|
Returns addOwnerToGroup(string $email, string $groupId) : \Zend_Gdata_Gapps_OwnerEntry
Add an email as an owner of a group
ParametersName | Type | Description |
---|
$email | string | Owner's email |
---|
$groupId | string | Group ownership to be checked for |
---|
Returns addRecipientToEmailList(string $recipientAddress, string $emailList) : \Zend_Gdata_Gapps_EmailListRecipientEntry
Add a specified recipient to an existing emailList.
ParametersName | Type | Description |
---|
$recipientAddress | string | The address of the recipient to be
added to the email list. |
---|
$emailList | string | The name of the email address to which the
recipient should be added. |
---|
ReturnsThrows createEmailList(string $emailList) : \Zend_Gdata_Gapps_EmailListEntry
ParametersName | Type | Description |
---|
$emailList | string | The name of the email list to be created. |
---|
ReturnsThrows createGroup(string $groupId, string $groupName, string $description = null, string $emailPermission = null) : \Zend_Gdata_Gapps_GroupEntry
ParametersName | Type | Description |
---|
$groupId | string | A unique identifier for the group |
---|
$groupName | string | The name of the group |
---|
$description | string | A description of the group |
---|
$emailPermission | string | The subscription permission of the group |
---|
Returns createNickname(string $username, string $nickname) : \Zend_Gdata_Gapps_NicknameEntry
Create a nickname for a given user.
ParametersName | Type | Description |
---|
$username | string | The username to which the new nickname should
be associated. |
---|
$nickname | string | The new nickname to be created. |
---|
ReturnsThrows createUser(string $username, string $givenName, string $familyName, string $password, $passwordHashFunction = null, string $quotaLimitInMB = null) : \Zend_Gdata_Gapps_UserEntry
Create a new user entry and send it to the Google Apps servers.
ParametersName | Type | Description |
---|
$username | string | The username for the new user. |
---|
$givenName | string | The given name for the new user. |
---|
$familyName | string | The family name for the new user. |
---|
$password | string | The password for the new user as a plaintext string
(if $passwordHashFunction is null) or a SHA-1 hashed
value (if $passwordHashFunction = 'SHA-1').
|
---|
$passwordHashFunction | | |
---|
$quotaLimitInMB | string | (optional) The quota limit for the new user in MB. |
---|
ReturnsThrows delete(mixed $data, integer $remainingRedirects = null) : void
DELETE entry with client object
This method overrides the default behavior of Zend_Gdata_App,
providing support for Zend_Gdata_Gapps_ServiceException.
ParametersName | Type | Description |
---|
$data | mixed | The Zend_Gdata_App_Entry or URL to delete |
---|
$remainingRedirects | integer | (optional) |
---|
Throws deleteEmailList(string $emailList) : void
Delete a specified email list.
ParametersName | Type | Description |
---|
$emailList | string | The name of the emailList to be deleted. |
---|
Throws deleteGroup(string $groupId) : void
ParametersName | Type | Description |
---|
$groupId | string | The unique identifier for the group |
---|
deleteNickname(string $nickname) : void
Delete a specified nickname.
ParametersName | Type | Description |
---|
$nickname | string | The name of the nickname to be deleted. |
---|
Throws deleteUser(string $username) : void
Delete a user by username.
ParametersName | Type | Description |
---|
$username | string | The username associated with the user who
should be deleted. |
---|
Throws get(string $uri, array $extraHeaders = array()) : \Zend_Http_Response
GET a URI using client object.
This method overrides the default behavior of Zend_Gdata_App,
providing support for Zend_Gdata_Gapps_ServiceException.
ParametersName | Type | Description |
---|
$uri | string | GET URI |
---|
$extraHeaders | array | Extra headers to add to the request, as an
array of string-based key/value pairs.
|
---|
ReturnsThrowsgetBaseUrl(string $domain = null) : void
Returns the base URL used to access the Google Apps service, based
on the current domain. The current domain can be temporarily
overridden by providing a fully qualified domain as $domain.
ParametersName | Type | Description |
---|
$domain | string | (optional) A fully-qualified domain to use
instead of the default domain for this service instance.
|
---|
Throws getDomain() : string
Get domain for this service instance. This should be a fully qualified
domain, such as 'foo.example.com'. If no domain is set, null will be
returned.
ReturnsType | Description |
---|
string | The domain to be used for this session, or null if not
set. |
getEmailListEntry(mixed $location) : \Zend_Gdata_Gapps_EmailListEntry
Retreive a single EmailListEntry object.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getEmailListFeed(mixed $location = null) : \Zend_Gdata_Gapps_EmailListFeed
Retreive EmailListFeed object containing multiple EmailListEntry
objects.
ParametersName | Type | Description |
---|
$location | mixed | (optional) The location for the feed, as a URL
or Query.
|
---|
ReturnsThrows getEmailListRecipientEntry(mixed $location) : \Zend_Gdata_Gapps_EmailListRecipientEntry
Retreive a single EmailListRecipientEntry object.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getEmailListRecipientFeed(mixed $location) : \Zend_Gdata_Gapps_EmailListRecipientFeed
Retreive EmailListRecipientFeed object containing multiple
EmailListRecipientEntry objects.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getGroupEntry(mixed $location = null) : \Zend_Gdata_Gapps_GroupEntry
Retreive a single GroupEntry object.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getGroupFeed(mixed $location = null) : \Zend_Gdata_Gapps_GroupFeed
Retreive GroupFeed object containing multiple GroupEntry
objects.
ParametersName | Type | Description |
---|
$location | mixed | (optional) The location for the feed, as a URL
or Query.
|
---|
ReturnsThrows getMemberEntry(mixed $location = null) : \Zend_Gdata_Gapps_MemberEntry
Retreive a single MemberEntry object.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getMemberFeed(mixed $location = null) : \Zend_Gdata_Gapps_MemberFeed
Retreive MemberFeed object containing multiple MemberEntry
objects.
ParametersName | Type | Description |
---|
$location | mixed | (optional) The location for the feed, as a URL
or Query.
|
---|
ReturnsThrows getNicknameEntry(mixed $location) : \Zend_Gdata_Gapps_NicknameEntry
Retreive a single NicknameEntry object.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getNicknameFeed(mixed $location = null) : \Zend_Gdata_Gapps_NicknameFeed
Retreive NicknameFeed object containing multiple NicknameEntry objects.
ParametersName | Type | Description |
---|
$location | mixed | (optional) The location for the feed, as a URL
or Query.
|
---|
ReturnsThrows getOwnerEntry(mixed $location = null) : \Zend_Gdata_Gapps_OwnerEntry
Retreive a single OwnerEntry object.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getOwnerFeed(mixed $location = null) : \Zend_Gdata_Gapps_OwnerFeed
Retreive OwnerFeed object containing multiple OwnerEntry
objects.
ParametersName | Type | Description |
---|
$location | mixed | (optional) The location for the feed, as a URL
or Query.
|
---|
ReturnsThrows getUserEntry(mixed $location) : \Zend_Gdata_Gapps_UserEntry
Retreive a single UserEntry object.
ParametersName | Type | Description |
---|
$location | mixed | The location for the feed, as a URL or Query. |
---|
ReturnsThrows getUserFeed(mixed $location = null) : \Zend_Gdata_Gapps_UserFeed
Retrieve a UserFeed containing multiple UserEntry objects.
ParametersName | Type | Description |
---|
$location | mixed | (optional) The location for the feed, as a URL
or Query.
|
---|
ReturnsThrows import(string $uri, \Zend_Http_Client $client = null, string $className = 'Zend_Gdata_App_Feed', $useObjectMapping = true) : \Zend_Gdata_App_Feed
staticImports a feed located at $uri.
This method overrides the default behavior of Zend_Gdata_App,
providing support for Zend_Gdata_Gapps_ServiceException.
ParametersName | Type | Description |
---|
$uri | string | |
---|
$client | \Zend_Http_Client | (optional) The client used for
communication
|
---|
$className | string | (optional) The class which is used as the
return type
|
---|
$useObjectMapping | | |
---|
ReturnsThrowsisMember(string $memberId, string $groupId) : bool
Check to see if a member id or group id is a member of group
ParametersName | Type | Description |
---|
$memberId | string | Member id or group group id |
---|
$groupId | string | Group to be checked for |
---|
ReturnsType | Description |
---|
bool | True, if given entity is a member |
isOwner(string $email, string $groupId) : bool
Checks to see if an email is an owner of a group
ParametersName | Type | Description |
---|
$email | string | Owner's email |
---|
$groupId | string | Group ownership to be checked for |
---|
ReturnsType | Description |
---|
bool | True, if given entity is an owner |
post(mixed $data, string $uri = null, integer $remainingRedirects = null, string $contentType = null, $extraHeaders = null) : \Zend_Http_Response
POST data with client object.
This method overrides the default behavior of Zend_Gdata_App,
providing support for Zend_Gdata_Gapps_ServiceException.
ParametersName | Type | Description |
---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
---|
$uri | string | (optional) POST URI |
---|
$remainingRedirects | integer | (optional) |
---|
$contentType | string | Content-type of the data |
---|
$extraHeaders | | |
---|
ReturnsThrowsput(mixed $data, string $uri = null, integer $remainingRedirects = null, string $contentType = null, $extraHeaders = null) : \Zend_Http_Response
PUT data with client object
This method overrides the default behavior of Zend_Gdata_App,
providing support for Zend_Gdata_Gapps_ServiceException.
ParametersName | Type | Description |
---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
---|
$uri | string | (optional) PUT URI |
---|
$remainingRedirects | integer | (optional) |
---|
$contentType | string | Content-type of the data |
---|
$extraHeaders | | |
---|
ReturnsThrows removeMemberFromGroup(string $memberId, string $groupId) : void
Remove a member id from a group
ParametersName | Type | Description |
---|
$memberId | string | Member id or group id |
---|
$groupId | string | The unique id of the group |
---|
removeOwnerFromGroup(string $email, string $groupId) : void
Remove email as an owner of a group
ParametersName | Type | Description |
---|
$email | string | Owner's email |
---|
$groupId | string | The unique identifier for the group |
---|
removeRecipientFromEmailList(string $recipientAddress, string $emailList) : void
Remove a specified recipient from an email list.
ParametersName | Type | Description |
---|
$recipientAddress | string | The recipient to be removed. |
---|
$emailList | string | The list from which the recipient should
be removed. |
---|
Throws restoreUser(string $username) : \Zend_Gdata_Gapps_UserEntry
Mark a given user as not suspended.
ParametersName | Type | Description |
---|
$username | string | The username associated with the user who
should be restored. |
---|
ReturnsThrows retrieveAllMembers(string $groupId) : \Zend_Gdata_Gapps_MemberFeed
Retrieves all the members of a group
ParametersName | Type | Description |
---|
$groupId | string | The unique id of the group |
---|
Returns retrieveAllRecipients( $emailList) : \Zend_Gdata_Gapps_EmailListRecipientFeed
Retrieve all recipients associated with an email list. Be aware that
calling this function on a domain with many email lists will take a
signifigant amount of time to complete. On larger domains this may
may cause execution to timeout without proper precautions in place.
ParametersName | Type | Description |
---|
$emailList | | |
---|
ReturnsThrows retrieveEmailLists( $recipient) : \Zend_Gdata_Gapps_EmailListFeed
Retrieve all email lists associated with a recipient.
ParametersName | Type | Description |
---|
$recipient | | |
---|
ReturnsThrows retrieveGroup(string $groupId) : \Zend_Gdata_Gapps_GroupEntry
Retrieves a group based on group id
ParametersName | Type | Description |
---|
$groupId | string | The unique identifier for the group |
---|
Returns retrieveGroupOwners(string $groupId) : \Zend_Gdata_Gapps_OwnerFeed
Retrieves all the owners of a group
ParametersName | Type | Description |
---|
$groupId | string | The unique identifier for the group |
---|
Returns retrieveGroups(string $memberId, bool $directOnly = null) : \Zend_Gdata_Gapps_GroupFeed
Retrieve all of the groups that a user is a member of
ParametersName | Type | Description |
---|
$memberId | string | Member username |
---|
$directOnly | bool | (Optional) If true, members with direct association
only will be considered
|
---|
ReturnsType | Description |
---|
\Zend_Gdata_Gapps_GroupFeed | Collection of Zend_Gdata_GroupEntry
objects representing all groups member is apart of in the domain. |
retrieveNickname(string $nickname) : \Zend_Gdata_Gapps_NicknameEntry
Retrieve the entry for a specified nickname.
ParametersName | Type | Description |
---|
$nickname | string | The nickname to be retrieved. |
---|
ReturnsThrows retrieveNicknames(string $username) : \Zend_Gdata_Gapps_NicknameFeed
Retrieve all nicknames associated with a specific username.
ParametersName | Type | Description |
---|
$username | string | The username whose nicknames should be
returned. |
---|
ReturnsThrows retrievePageOfEmailLists( $startNickname = null) : \Zend_Gdata_Gapps_EmailListFeed
Retrieve a page of email lists in alphabetical order, starting with the
provided email list.
ParametersName | Type | Description |
---|
$startNickname | | |
---|
ReturnsThrows retrievePageOfGroups(string $startGroup = null) : \Zend_Gdata_Gapps_GroupFeed
Retrieve a page of groups in alphabetical order, starting with the
provided group.
ParametersName | Type | Description |
---|
$startGroup | string | (optional) The first group to
retrieve. If null or not defined, the page will begin
with the first group in the domain.
|
---|
ReturnsThrows retrievePageOfMembers(string $groupId, string $startMember = null) : \Zend_Gdata_Gapps_MemberFeed
ParametersName | Type | Description |
---|
$groupId | string | The group id which should be searched. |
---|
$startMember | string | (optinal) The address of the first member,
or null to start with the first member in the list.
|
---|
Returns retrievePageOfNicknames(string $startNickname = null) : \Zend_Gdata_Gapps_NicknameFeed
Retrieve a page of nicknames in alphabetical order, starting with the
provided nickname.
ParametersName | Type | Description |
---|
$startNickname | string | (optional) The first nickname to
retrieve. If null or not declared, the page will begin with
the first nickname in the domain.
|
---|
ReturnsThrows retrievePageOfRecipients( $emailList, string $startRecipient = null) : \Zend_Gdata_Gapps_EmailListRecipientFeed
Retrieve a page of email list recipients in alphabetical order,
starting with the provided email list recipient.
ParametersName | Type | Description |
---|
$emailList | | |
---|
$startRecipient | string | (optinal) The address of the first
recipient, or null to start with the first recipient in
the list.
|
---|
ReturnsThrows retrievePageOfUsers(string $startUsername = null) : \Zend_Gdata_Gapps_UserFeed
Retrieve a page of users in alphabetical order, starting with the
provided username.
ParametersName | Type | Description |
---|
$startUsername | string | (optional) The first username to retrieve.
If null or not declared, the page will begin with the first
user in the domain.
|
---|
ReturnsThrows retrieveUser(string $username) : \Zend_Gdata_Gapps_UserEntry
Retrieve a user based on their username.
ParametersName | Type | Description |
---|
$username | string | The username to search for. |
---|
ReturnsThrows setDomain(string $value) : void
Set domain for this service instance. This should be a fully qualified
domain, such as 'foo.example.com'.
This value is used when calculating URLs for retrieving and posting
entries. If no value is specified, a URL will have to be manually
constructed prior to using any methods which interact with the Google
Apps provisioning service.
ParametersName | Type | Description |
---|
$value | string | The domain to be used for this session. |
---|
suspendUser(string $username) : \Zend_Gdata_Gapps_UserEntry
Mark a given user as suspended.
ParametersName | Type | Description |
---|
$username | string | The username associated with the user who
should be suspended. |
---|
ReturnsThrows updateGroup(string $groupId, string $groupName = null, string $description = null, string $emailPermission = null) : \Zend_Gdata_Gapps_GroupEntry
Update group properties with new values. any property not defined will not
be updated
ParametersName | Type | Description |
---|
$groupId | string | A unique identifier for the group |
---|
$groupName | string | The name of the group |
---|
$description | string | A description of the group |
---|
$emailPermission | string | The subscription permission of the group |
---|
Returns updateUser(string $username, \Zend_Gdata_Gapps_UserEntry $userEntry) : \Zend_Gdata_Gapps_UserEntry
Overwrite a specified username with the provided UserEntry. The
UserEntry does not need to contain an edit link.
This method is provided for compliance with the Google Apps
Provisioning API specification. Normally users will instead want to
call UserEntry::save() instead.
ParametersName | Type | Description |
---|
$username | string | The username whose data will be overwritten. |
---|
$userEntry | \Zend_Gdata_Gapps_UserEntry | The user entry which
will be overwritten. |
---|
ReturnsThrowsDetails- See
-