Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
Zend_Gdata_Gapps Class Reference

Public Member Functions

 __construct ($client=null, $domain=null, $applicationId= 'MyCompany-MyApp-1.0')
 Create Gdata_Gapps object.
 
 get ($uri, $extraHeaders=array())
 GET a URI using client object.
 
 post ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 POST data with client object.
 
 put ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 PUT data with client object This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.
 
 delete ($data, $remainingRedirects=null)
 DELETE entry with client object This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.
 
 setDomain ($value)
 Set domain for this service instance.
 
 getDomain ()
 Get domain for this service instance.
 
 getBaseUrl ($domain=null)
 Returns the base URL used to access the Google Apps service, based on the current domain.
 
 getUserFeed ($location=null)
 Retrieve a UserFeed containing multiple UserEntry objects.
 
 getNicknameFeed ($location=null)
 Retreive NicknameFeed object containing multiple NicknameEntry objects.
 
 getGroupFeed ($location=null)
 Retreive GroupFeed object containing multiple GroupEntry objects.
 
 getMemberFeed ($location=null)
 Retreive MemberFeed object containing multiple MemberEntry objects.
 
 getOwnerFeed ($location=null)
 Retreive OwnerFeed object containing multiple OwnerEntry objects.
 
 getEmailListFeed ($location=null)
 Retreive EmailListFeed object containing multiple EmailListEntry objects.
 
 getEmailListRecipientFeed ($location)
 Retreive EmailListRecipientFeed object containing multiple EmailListRecipientEntry objects.
 
 getUserEntry ($location)
 Retreive a single UserEntry object.
 
 getNicknameEntry ($location)
 Retreive a single NicknameEntry object.
 
 getGroupEntry ($location=null)
 Retreive a single GroupEntry object.
 
 getMemberEntry ($location=null)
 Retreive a single MemberEntry object.
 
 getOwnerEntry ($location=null)
 Retreive a single OwnerEntry object.
 
 getEmailListEntry ($location)
 Retreive a single EmailListEntry object.
 
 getEmailListRecipientEntry ($location)
 Retreive a single EmailListRecipientEntry object.
 
 insertUser ($user, $uri=null)
 Create a new user from a UserEntry.
 
 insertNickname ($nickname, $uri=null)
 Create a new nickname from a NicknameEntry.
 
 insertGroup ($group, $uri=null)
 Create a new group from a GroupEntry.
 
 insertMember ($member, $uri=null)
 Create a new member from a MemberEntry.
 
 insertOwner ($owner, $uri=null)
 Create a new group from a OwnerEntry.
 
 insertEmailList ($emailList, $uri=null)
 Create a new email list from an EmailListEntry.
 
 insertEmailListRecipient ($recipient, $uri=null)
 Create a new email list recipient from an EmailListRecipientEntry.
 
 __call ($method, $args)
 Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions.
 
 createUser ($username, $givenName, $familyName, $password, $passwordHashFunction=null, $quotaLimitInMB=null)
 Create a new user entry and send it to the Google Apps servers.
 
 retrieveUser ($username)
 Retrieve a user based on their username.
 
 retrievePageOfUsers ($startUsername=null)
 Retrieve a page of users in alphabetical order, starting with the provided username.
 
 retrieveAllUsers ()
 Retrieve all users in the current domain.
 
 updateUser ($username, $userEntry)
 Overwrite a specified username with the provided UserEntry.
 
 suspendUser ($username)
 Mark a given user as suspended.
 
 restoreUser ($username)
 Mark a given user as not suspended.
 
 deleteUser ($username)
 Delete a user by username.
 
 createNickname ($username, $nickname)
 Create a nickname for a given user.
 
 retrieveNickname ($nickname)
 Retrieve the entry for a specified nickname.
 
 retrieveNicknames ($username)
 Retrieve all nicknames associated with a specific username.
 
 retrievePageOfNicknames ($startNickname=null)
 Retrieve a page of nicknames in alphabetical order, starting with the provided nickname.
 
 retrieveAllNicknames ()
 Retrieve all nicknames in the current domain.
 
 deleteNickname ($nickname)
 Delete a specified nickname.
 
 createGroup ($groupId, $groupName, $description=null, $emailPermission=null)
 Create a new group.
 
 retrieveGroup ($groupId)
 Retrieves a group based on group id.
 
 retrieveAllGroups ()
 Retrieve all groups in the current domain.
 
 deleteGroup ($groupId)
 Delete a group.
 
 isMember ($memberId, $groupId)
 Check to see if a member id or group id is a member of group.
 
 addMemberToGroup ($recipientAddress, $groupId)
 Add an email address to a group as a member.
 
 removeMemberFromGroup ($memberId, $groupId)
 Remove a member id from a group.
 
 retrieveAllMembers ($groupId)
 Retrieves all the members of a group.
 
 addOwnerToGroup ($email, $groupId)
 Add an email as an owner of a group.
 
 retrieveGroupOwners ($groupId)
 Retrieves all the owners of a group.
 
 isOwner ($email, $groupId)
 Checks to see if an email is an owner of a group.
 
 removeOwnerFromGroup ($email, $groupId)
 Remove email as an owner of a group.
 
 updateGroup ($groupId, $groupName=null, $description=null, $emailPermission=null)
 Update group properties with new values.
 
 retrieveGroups ($memberId, $directOnly=null)
 Retrieve all of the groups that a user is a member of.
 
 retrievePageOfGroups ($startGroup=null)
 Retrieve a page of groups in alphabetical order, starting with the provided group.
 
 retrievePageOfMembers ($groupId, $startMember=null)
 Gets page of Members.
 
 createEmailList ($emailList)
 Create a new email list.
 
 retrieveEmailLists ($recipient)
 Retrieve all email lists associated with a recipient.
 
 retrievePageOfEmailLists ($startNickname=null)
 Retrieve a page of email lists in alphabetical order, starting with the provided email list.
 
 retrieveAllEmailLists ()
 Retrieve all email lists associated with the curent domain.
 
 deleteEmailList ($emailList)
 Delete a specified email list.
 
 addRecipientToEmailList ($recipientAddress, $emailList)
 Add a specified recipient to an existing emailList.
 
 retrievePageOfRecipients ($emailList, $startRecipient=null)
 Retrieve a page of email list recipients in alphabetical order, starting with the provided email list recipient.
 
 retrieveAllRecipients ($emailList)
 Retrieve all recipients associated with an email list.
 
 removeRecipientFromEmailList ($recipientAddress, $emailList)
 Remove a specified recipient from an email list.
 
- Public Member Functions inherited from Zend_Gdata
 __construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0')
 Create Gdata object.
 
 getFeed ($location, $className='Zend_Gdata_Feed')
 Retrieve feed as string or object.
 
 getEntry ($location, $className='Zend_Gdata_Entry')
 Retrieve entry as string or object.
 
 performHttpRequest ($method, $url, $headers=array(), $body=null, $contentType=null, $remainingRedirects=null)
 Performs a HTTP request using the specified method.
 
 isAuthenticated ()
 Determines whether service object is authenticated.
 
- Public Member Functions inherited from Zend_Gdata_App
 __construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0')
 Create Gdata object.
 
 registerPackage ($name)
 Adds a Zend Framework package to the $_registeredPackages array.
 
 getFeed ($uri, $className='Zend_Gdata_App_Feed')
 Retrieve feed as string or object.
 
 getEntry ($uri, $className='Zend_Gdata_App_Entry')
 Retrieve entry as string or object.
 
 getHttpClient ()
 Get the Zend_Http_Client object used for communication.
 
 setHttpClient ($client, $applicationId= 'MyCompany-MyApp-1.0')
 Set the Zend_Http_Client object used for communication.
 
 setMajorProtocolVersion ($value)
 Set the major protocol version that should be used.
 
 getMajorProtocolVersion ()
 Get the major protocol version that is in use.
 
 setMinorProtocolVersion ($value)
 Set the minor protocol version that should be used.
 
 getMinorProtocolVersion ()
 Get the minor protocol version that is in use.
 
 prepareRequest ($method, $url=null, $headers=array(), $data=null, $contentTypeOverride=null)
 Provides pre-processing for HTTP requests to APP services.
 
 performHttpRequest ($method, $url, $headers=null, $body=null, $contentType=null, $remainingRedirects=null)
 Performs a HTTP request using the specified method.
 
 importUrl ($url, $className='Zend_Gdata_App_Feed', $extraHeaders=array())
 Imports the specified URL (non-statically).
 
 get ($uri, $extraHeaders=array())
 GET a URI using client object.
 
 post ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 POST data with client object.
 
 put ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 PUT data with client object.
 
 delete ($data, $remainingRedirects=null)
 DELETE entry with client object.
 
 insertEntry ($data, $uri, $className='Zend_Gdata_App_Entry', $extraHeaders=array())
 Inserts an entry to a given URI and returns the response as a fully formed Entry.
 
 updateEntry ($data, $uri=null, $className=null, $extraHeaders=array())
 Update an entry.
 
 __call ($method, $args)
 Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions.
 
 retrieveAllEntriesForFeed ($feed)
 Retrieve all entries for a feed, iterating through pages as necessary.
 
 enableRequestDebugLogging ($logfile)
 This method enables logging of requests by changing the Zend_Http_Client_Adapter used for performing the requests.
 
 getNextFeed ($feed, $className=null)
 Retrieve next set of results based on a given feed.
 
 getPreviousFeed ($feed, $className=null)
 Retrieve previous set of results based on a given feed.
 
 generateIfMatchHeaderData ($data, $allowWeek)
 Returns the data for an If-Match header based on the current Etag property.
 
 usingObjectMapping ()
 Determine whether service object is using XML to object mapping.
 
 useObjectMapping ($value)
 Enable/disable the use of XML to object mapping.
 

Static Public Member Functions

static throwServiceExceptionIfDetected ($e)
 Convert an exception to an ServiceException if an AppsForYourDomain XML document is contained within the original exception's HTTP response.
 
static import ($uri, $client=null, $className='Zend_Gdata_App_Feed', $useObjectMapping=true)
 Imports a feed located at $uri.
 
- Static Public Member Functions inherited from Zend_Gdata
static import ($uri, $client=null, $className='Zend_Gdata_Feed', $useObjectMapping=true)
 Imports a feed located at $uri.
 
- Static Public Member Functions inherited from Zend_Gdata_App
static setStaticHttpClient (Zend_Http_Client $httpClient)
 Set the static HTTP client instance.
 
static getStaticHttpClient ()
 Gets the HTTP client object.
 
static setHttpMethodOverride ($override=true)
 Toggle using POST instead of PUT and DELETE HTTP methods.
 
static getHttpMethodOverride ()
 Get the HTTP override state.
 
static setGzipEnabled ($enabled=false)
 Toggle requesting gzip encoded responses.
 
static getGzipEnabled ()
 Get the HTTP override state.
 
static getVerboseExceptionMessages ()
 Get whether to use verbose exception messages.
 
static setVerboseExceptionMessages ($verbose)
 Set whether to use verbose exception messages.
 
static setMaxRedirects ($maxRedirects)
 Set the maximum number of redirects to follow during HTTP operations.
 
static getMaxRedirects ()
 Get the maximum number of redirects to follow during HTTP operations.
 
static import ($uri, $client=null, $className='Zend_Gdata_App_Feed', $useObjectMapping=true)
 Imports a feed located at $uri.
 
static importString ($string, $className='Zend_Gdata_App_Feed', $majorProtocolVersion=null, $minorProtocolVersion=null)
 Imports a feed represented by $string.
 
static importFile ($filename, $className='Zend_Gdata_App_Feed', $useIncludePath=false)
 Imports a feed from a file located at $filename.
 

Public Attributes

const APPS_BASE_FEED_URI = 'https://apps-apis.google.com/a/feeds'
 
const AUTH_SERVICE_NAME = 'apps'
 
const APPS_USER_PATH = '/user/2.0'
 Path to user feeds on the Google Apps server.
 
const APPS_NICKNAME_PATH = '/nickname/2.0'
 Path to nickname feeds on the Google Apps server.
 
const APPS_GROUP_PATH = '/group/2.0'
 Path to group feeds on the Google Apps server.
 
const APPS_EMAIL_LIST_PATH = '/emailList/2.0'
 Path to email list feeds on the Google Apps server.
 
const APPS_EMAIL_LIST_RECIPIENT_POSTFIX = '/recipient'
 Path to email list recipient feeds on the Google Apps server.
 
- Public Attributes inherited from Zend_Gdata
const AUTH_SERVICE_NAME = 'xapi'
 
- Public Attributes inherited from Zend_Gdata_App
const DEFAULT_MAJOR_PROTOCOL_VERSION = 1
 Default major protocol version.
 
const DEFAULT_MINOR_PROTOCOL_VERSION = null
 Default minor protocol version.
 

Static Public Attributes

static $namespaces
 
- Static Public Attributes inherited from Zend_Gdata
static $namespaces
 

Protected Attributes

 $_domain = null
 
- Protected Attributes inherited from Zend_Gdata
 $_defaultPostUri = null
 
 $_registeredPackages
 
 $_httpClient
 
- Protected Attributes inherited from Zend_Gdata_App
 $_httpClient
 
 $_defaultPostUri = null
 
 $_registeredPackages
 
 $_majorProtocolVersion
 Indicates the major protocol version that should be used.
 
 $_minorProtocolVersion
 Indicates the minor protocol version that should be used.
 
 $_useObjectMapping = true
 

Additional Inherited Members

- Static Protected Attributes inherited from Zend_Gdata
static $_staticHttpClient = null
 

Constructor & Destructor Documentation

__construct (   $client = null,
  $domain = null,
  $applicationId = 'MyCompany-MyApp-1.0' 
)

Create Gdata_Gapps object.

Parameters
Zend_Http_Client$client(optional) The HTTP client to use when when communicating with the Google Apps servers.
string$domain(optional) The Google Apps domain which is to be accessed.
string$applicationIdThe identity of the app in the form of Company-AppName-Version

Member Function Documentation

__call (   $method,
  $args 
)

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.

See Also
Zend_Gdata_App::__call()
Parameters
string$methodThe method name being called
array$argsThe arguments passed to the call
Exceptions
Zend_Gdata_App_Exception
addMemberToGroup (   $recipientAddress,
  $groupId 
)

Add an email address to a group as a member.

Parameters
string$recipientAddressEmail address, member id, or group id
string$groupIdThe unique id of the group
Returns
Zend_Gdata_Gapps_MemberEntry The member entry returned by the server
addOwnerToGroup (   $email,
  $groupId 
)

Add an email as an owner of a group.

Parameters
string$emailOwner's email
string$groupIdGroup ownership to be checked for
Returns
Zend_Gdata_Gapps_OwnerEntry The OwnerEntry returned by the server
addRecipientToEmailList (   $recipientAddress,
  $emailList 
)

Add a specified recipient to an existing emailList.

Parameters
string$recipientAddressThe address of the recipient to be added to the email list.
string$emailListThe name of the email address to which the recipient should be added.
Returns
Zend_Gdata_Gapps_EmailListRecipientEntry The recipient entry created by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
createEmailList (   $emailList)

Create a new email list.

Parameters
string$emailListThe name of the email list to be created.
Returns
Zend_Gdata_Gapps_EmailListEntry The email list entry as created on the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
createGroup (   $groupId,
  $groupName,
  $description = null,
  $emailPermission = null 
)

Create a new group.

Parameters
string$groupIdA unique identifier for the group
string$groupNameThe name of the group
string$descriptionA description of the group
string$emailPermissionThe subscription permission of the group
Returns
Zend_Gdata_Gapps_GroupEntry The group entry as created on the server.
createNickname (   $username,
  $nickname 
)

Create a nickname for a given user.

Parameters
string$usernameThe username to which the new nickname should be associated.
string$nicknameThe new nickname to be created.
Returns
Zend_Gdata_Gapps_NicknameEntry The nickname entry which was created by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
createUser (   $username,
  $givenName,
  $familyName,
  $password,
  $passwordHashFunction = null,
  $quotaLimitInMB = null 
)

Create a new user entry and send it to the Google Apps servers.

Parameters
string$usernameThe username for the new user.
string$givenNameThe given name for the new user.
string$familyNameThe family name for the new user.
string$passwordThe password for the new user as a plaintext string (if $passwordHashFunction is null) or a SHA-1 hashed value (if $passwordHashFunction = 'SHA-1').
string$quotaLimitInMB(optional) The quota limit for the new user in MB.
Returns
Zend_Gdata_Gapps_UserEntry (optional) The new user entry as returned by server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
delete (   $data,
  $remainingRedirects = null 
)

DELETE entry with client object This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.

Parameters
mixed$dataThe Zend_Gdata_App_Entry or URL to delete
integer$remainingRedirects(optional)
Returns
void
Exceptions
Zend_Gdata_App_HttpException
Zend_Gdata_App_InvalidArgumentException
Zend_Gdata_Gapps_ServiceException
deleteEmailList (   $emailList)

Delete a specified email list.

Parameters
string$emailListThe name of the emailList to be deleted.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
deleteGroup (   $groupId)

Delete a group.

Parameters
string$groupIdThe unique identifier for the group
deleteNickname (   $nickname)

Delete a specified nickname.

Parameters
string$nicknameThe name of the nickname to be deleted.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
deleteUser (   $username)

Delete a user by username.

Parameters
string$usernameThe username associated with the user who should be deleted.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
get (   $uri,
  $extraHeaders = array() 
)

GET a URI using client object.

This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.

Parameters
string$uriGET URI
array$extraHeadersExtra headers to add to the request, as an array of string-based key/value pairs.
Exceptions
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
Returns
Zend_Http_Response
getBaseUrl (   $domain = null)

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.

Parameters
string$domain(optional) A fully-qualified domain to use instead of the default domain for this service instance.
Exceptions
Zend_Gdata_App_InvalidArgumentException
getDomain ( )

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.

Returns
string The domain to be used for this session, or null if not set.
getEmailListEntry (   $location)

Retreive a single EmailListEntry object.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_EmailListEntry
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getEmailListFeed (   $location = null)

Retreive EmailListFeed object containing multiple EmailListEntry objects.

Parameters
mixed$location(optional) The location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_EmailListFeed
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getEmailListRecipientEntry (   $location)

Retreive a single EmailListRecipientEntry object.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_EmailListRecipientEntry
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getEmailListRecipientFeed (   $location)

Retreive EmailListRecipientFeed object containing multiple EmailListRecipientEntry objects.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_EmailListRecipientFeed
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getGroupEntry (   $location = null)

Retreive a single GroupEntry object.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_GroupEntry
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getGroupFeed (   $location = null)

Retreive GroupFeed object containing multiple GroupEntry objects.

Parameters
mixed$location(optional) The location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_GroupFeed
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getMemberEntry (   $location = null)

Retreive a single MemberEntry object.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_MemberEntry
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getMemberFeed (   $location = null)

Retreive MemberFeed object containing multiple MemberEntry objects.

Parameters
mixed$location(optional) The location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_MemberFeed
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getNicknameEntry (   $location)

Retreive a single NicknameEntry object.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_NicknameEntry
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getNicknameFeed (   $location = null)

Retreive NicknameFeed object containing multiple NicknameEntry objects.

Parameters
mixed$location(optional) The location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_NicknameFeed
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getOwnerEntry (   $location = null)

Retreive a single OwnerEntry object.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_OwnerEntry
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getOwnerFeed (   $location = null)

Retreive OwnerFeed object containing multiple OwnerEntry objects.

Parameters
mixed$location(optional) The location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_OwnerFeed
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getUserEntry (   $location)

Retreive a single UserEntry object.

Parameters
mixed$locationThe location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_UserEntry
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
getUserFeed (   $location = null)

Retrieve a UserFeed containing multiple UserEntry objects.

Parameters
mixed$location(optional) The location for the feed, as a URL or Query.
Returns
Zend_Gdata_Gapps_UserFeed
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
static import (   $uri,
  $client = null,
  $className = 'Zend_Gdata_App_Feed',
  $useObjectMapping = true 
)
static

Imports a feed located at $uri.

This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.

Parameters
string$uri
Zend_Http_Client$client(optional) The client used for communication
string$className(optional) The class which is used as the return type
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
Returns
Zend_Gdata_App_Feed
insertEmailList (   $emailList,
  $uri = null 
)

Create a new email list from an EmailListEntry.

Parameters
Zend_Gdata_Gapps_EmailListEntry$emailListThe email list entry to insert.
string$uri(optional) The URI where the email list should be uploaded to. If null, the default email list creation URI for this domain will be used.
Returns
Zend_Gdata_Gapps_EmailListEntry The inserted email list entry as returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
insertEmailListRecipient (   $recipient,
  $uri = null 
)

Create a new email list recipient from an EmailListRecipientEntry.

Parameters
Zend_Gdata_Gapps_EmailListRecipientEntry$recipientThe recipient entry to insert.
string$uri(optional) The URI where the recipient should be uploaded to. If null, the default recipient creation URI for this domain will be used.
Returns
Zend_Gdata_Gapps_EmailListRecipientEntry The inserted recipient entry as returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
insertGroup (   $group,
  $uri = null 
)

Create a new group from a GroupEntry.

Parameters
Zend_Gdata_Gapps_GroupEntry$groupThe group entry to insert.
string$uri(optional) The URI where the group should be uploaded to. If null, the default user creation URI for this domain will be used.
Returns
Zend_Gdata_Gapps_GroupEntry The inserted group entry as returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
insertMember (   $member,
  $uri = null 
)

Create a new member from a MemberEntry.

Parameters
Zend_Gdata_Gapps_MemberEntry$memberThe member entry to insert.
string$uri(optional) The URI where the group should be uploaded to. If null, the default user creation URI for this domain will be used.
Returns
Zend_Gdata_Gapps_MemberEntry The inserted member entry as returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
insertNickname (   $nickname,
  $uri = null 
)

Create a new nickname from a NicknameEntry.

Parameters
Zend_Gdata_Gapps_NicknameEntry$nicknameThe nickname entry to insert.
string$uri(optional) The URI where the nickname should be uploaded to. If null, the default nickname creation URI for this domain will be used.
Returns
Zend_Gdata_Gapps_NicknameEntry The inserted nickname entry as returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
insertOwner (   $owner,
  $uri = null 
)

Create a new group from a OwnerEntry.

Parameters
Zend_Gdata_Gapps_OwnerEntry$ownerThe owner entry to insert.
string$uri(optional) The URI where the owner should be uploaded to. If null, the default user creation URI for this domain will be used.
Returns
Zend_Gdata_Gapps_OwnerEntry The inserted owner entry as returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
insertUser (   $user,
  $uri = null 
)

Create a new user from a UserEntry.

Parameters
Zend_Gdata_Gapps_UserEntry$userThe user entry to insert.
string$uri(optional) The URI where the user should be uploaded to. If null, the default user creation URI for this domain will be used.
Returns
Zend_Gdata_Gapps_UserEntry The inserted user entry as returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
isMember (   $memberId,
  $groupId 
)

Check to see if a member id or group id is a member of group.

Parameters
string$memberIdMember id or group group id
string$groupIdGroup to be checked for
Returns
bool True, if given entity is a member
isOwner (   $email,
  $groupId 
)

Checks to see if an email is an owner of a group.

Parameters
string$emailOwner's email
string$groupIdGroup ownership to be checked for
Returns
bool True, if given entity is an owner
post (   $data,
  $uri = null,
  $remainingRedirects = null,
  $contentType = null,
  $extraHeaders = null 
)

POST data with client object.

This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.

Parameters
mixed$dataThe Zend_Gdata_App_Entry or XML to post
string$uri(optional) POST URI
integer$remainingRedirects(optional)
string$contentTypeContent-type of the data
array$extraHadersExtra headers to add tot he request
Returns
Zend_Http_Response
Exceptions
Zend_Gdata_App_HttpException
Zend_Gdata_App_InvalidArgumentException
Zend_Gdata_Gapps_ServiceException
put (   $data,
  $uri = null,
  $remainingRedirects = null,
  $contentType = null,
  $extraHeaders = null 
)

PUT data with client object This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.

Parameters
mixed$dataThe Zend_Gdata_App_Entry or XML to post
string$uri(optional) PUT URI
integer$remainingRedirects(optional)
string$contentTypeContent-type of the data
array$extraHadersExtra headers to add tot he request
Returns
Zend_Http_Response
Exceptions
Zend_Gdata_App_HttpException
Zend_Gdata_App_InvalidArgumentException
Zend_Gdata_Gapps_ServiceException
removeMemberFromGroup (   $memberId,
  $groupId 
)

Remove a member id from a group.

Parameters
string$memberIdMember id or group id
string$groupIdThe unique id of the group
removeOwnerFromGroup (   $email,
  $groupId 
)

Remove email as an owner of a group.

Parameters
string$emailOwner's email
string$groupIdThe unique identifier for the group
removeRecipientFromEmailList (   $recipientAddress,
  $emailList 
)

Remove a specified recipient from an email list.

Parameters
string$recipientAddressThe recipient to be removed.
string$emailListThe list from which the recipient should be removed.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
restoreUser (   $username)

Mark a given user as not suspended.

Parameters
string$usernameThe username associated with the user who should be restored.
Returns
Zend_Gdata_Gapps_UserEntry The UserEntry for the modified user.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveAllEmailLists ( )

Retrieve all email lists associated with the curent domain.

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.

Returns
Zend_Gdata_Gapps_EmailListFeed The list of email lists found as Zend_Gdata_Gapps_EmailListEntry objects.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveAllGroups ( )

Retrieve all groups in the current domain.

Be aware that calling this function on a domain with many groups will take a signifigant amount of time to complete. On larger domains this may may cause execution to timeout without proper precautions in place.

Returns
Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing all groups apart of the domain.
retrieveAllMembers (   $groupId)

Retrieves all the members of a group.

Parameters
string$groupIdThe unique id of the group
Returns
Zend_Gdata_Gapps_MemberFeed Collection of MemberEntry objects representing all members apart of the group.
retrieveAllNicknames ( )

Retrieve all nicknames in the current domain.

Be aware that calling this function on a domain with many nicknames will take a signifigant amount of time to complete. On larger domains this may may cause execution to timeout without proper precautions in place.

Returns
Zend_Gdata_Gapps_NicknameFeed Collection of Zend_Gdata_NicknameEntry objects representing all nicknames in the domain.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveAllRecipients (   $emailList)

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.

Parameters
string$emaiListThe email list which should be searched.
Returns
Zend_Gdata_Gapps_EmailListRecipientFeed The list of email lists found as Zend_Gdata_Gapps_EmailListRecipientEntry objects.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveAllUsers ( )

Retrieve all users in the current domain.

Be aware that calling this function on a domain with many users will take a signifigant amount of time to complete. On larger domains this may may cause execution to timeout without proper precautions in place.

Returns
Zend_Gdata_Gapps_UserFeed Collection of Zend_Gdata_UserEntry objects representing all users in the domain.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveEmailLists (   $recipient)

Retrieve all email lists associated with a recipient.

Parameters
string$usernameThe recipient whose associated email lists should be returned.
Returns
Zend_Gdata_Gapps_EmailListFeed The list of email lists found as Zend_Gdata_EmailListEntry objects.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveGroup (   $groupId)

Retrieves a group based on group id.

Parameters
string$groupIdThe unique identifier for the group
Returns
Zend_Gdata_Gapps_GroupEntry The group entry as returned by the server.
retrieveGroupOwners (   $groupId)

Retrieves all the owners of a group.

Parameters
string$groupIdThe unique identifier for the group
Returns
Zend_Gdata_Gapps_OwnerFeed Collection of Zend_Gdata_OwnerEntry objects representing all owners apart of the group.
retrieveGroups (   $memberId,
  $directOnly = null 
)

Retrieve all of the groups that a user is a member of.

Parameters
string$memberIdMember username
bool$directOnly(Optional) If true, members with direct association only will be considered
Returns
Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing all groups member is apart of in the domain.
retrieveNickname (   $nickname)

Retrieve the entry for a specified nickname.

Parameters
string$nicknameThe nickname to be retrieved.
Returns
Zend_Gdata_Gapps_NicknameEntry The requested nickname entry.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveNicknames (   $username)

Retrieve all nicknames associated with a specific username.

Parameters
string$usernameThe username whose nicknames should be returned.
Returns
Zend_Gdata_Gapps_NicknameFeed A feed containing all nicknames for the given user, or null if
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrievePageOfEmailLists (   $startNickname = null)

Retrieve a page of email lists in alphabetical order, starting with the provided email list.

Parameters
string$startEmailListName(optional) The first list to retrieve. If null or not defined, the page will begin with the first email list in the domain.
Returns
Zend_Gdata_Gapps_EmailListFeed Collection of Zend_Gdata_EmailListEntry objects representing all nicknames in the domain.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrievePageOfGroups (   $startGroup = null)

Retrieve a page of groups in alphabetical order, starting with the provided group.

Parameters
string$startGroup(optional) The first group to retrieve. If null or not defined, the page will begin with the first group in the domain.
Returns
Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing the groups in the domain.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrievePageOfMembers (   $groupId,
  $startMember = null 
)

Gets page of Members.

Parameters
string$groupIdThe group id which should be searched.
string$startMember(optinal) The address of the first member, or null to start with the first member in the list.
Returns
Zend_Gdata_Gapps_MemberFeed Collection of Zend_Gdata_MemberEntry objects
retrievePageOfNicknames (   $startNickname = null)

Retrieve a page of nicknames in alphabetical order, starting with the provided nickname.

Parameters
string$startNickname(optional) The first nickname to retrieve. If null or not declared, the page will begin with the first nickname in the domain.
Returns
Zend_Gdata_Gapps_NicknameFeed Collection of Zend_Gdata_NicknameEntry objects representing all nicknames in the domain.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrievePageOfRecipients (   $emailList,
  $startRecipient = null 
)

Retrieve a page of email list recipients in alphabetical order, starting with the provided email list recipient.

Parameters
string$emaiListThe email list which should be searched.
string$startRecipient(optinal) The address of the first recipient, or null to start with the first recipient in the list.
Returns
Zend_Gdata_Gapps_EmailListRecipientFeed Collection of Zend_Gdata_EmailListRecipientEntry objects representing all recpients in the specified list.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrievePageOfUsers (   $startUsername = null)

Retrieve a page of users in alphabetical order, starting with the provided username.

Parameters
string$startUsername(optional) The first username to retrieve. If null or not declared, the page will begin with the first user in the domain.
Returns
Zend_Gdata_Gapps_UserFeed Collection of Zend_Gdata_UserEntry objects representing all users in the domain.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
retrieveUser (   $username)

Retrieve a user based on their username.

Parameters
string$usernameThe username to search for.
Returns
Zend_Gdata_Gapps_UserEntry The username to search for, or null if no match found.
Exceptions
Zend_Gdata_App_InvalidArgumentException
Zend_Gdata_App_HttpException
setDomain (   $value)

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.

Parameters
string$valueThe domain to be used for this session.
suspendUser (   $username)

Mark a given user as suspended.

Parameters
string$usernameThe username associated with the user who should be suspended.
Returns
Zend_Gdata_Gapps_UserEntry The UserEntry for the modified user.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException
static throwServiceExceptionIfDetected (   $e)
static

Convert an exception to an ServiceException if an AppsForYourDomain XML document is contained within the original exception's HTTP response.

If conversion fails, throw the original error.

Parameters
Zend_Gdata_Exception$eThe exception to convert.
Exceptions
Zend_Gdata_Gapps_ServiceException
mixed
updateGroup (   $groupId,
  $groupName = null,
  $description = null,
  $emailPermission = null 
)

Update group properties with new values.

any property not defined will not be updated

Parameters
string$groupIdA unique identifier for the group
string$groupNameThe name of the group
string$descriptionA description of the group
string$emailPermissionThe subscription permission of the group
Returns
Zend_Gdata_Gapps_GroupEntry The group entry as updated on the server.
updateUser (   $username,
  $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.

See Also
Zend_Gdata_App_Entry::save
Parameters
string$usernameThe username whose data will be overwritten.
Zend_Gdata_Gapps_UserEntry$userEntryThe user entry which will be overwritten.
Returns
Zend_Gdata_Gapps_UserEntry The UserEntry returned by the server.
Exceptions
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_Gapps_ServiceException

Member Data Documentation

$_domain = null
protected
$namespaces
static
Initial value:
= array(
array('apps', 'http://schemas.google.com/apps/2006', 1, 0)
)
const APPS_BASE_FEED_URI = 'https://apps-apis.google.com/a/feeds'
const APPS_EMAIL_LIST_PATH = '/emailList/2.0'

Path to email list feeds on the Google Apps server.

const APPS_EMAIL_LIST_RECIPIENT_POSTFIX = '/recipient'

Path to email list recipient feeds on the Google Apps server.

const APPS_GROUP_PATH = '/group/2.0'

Path to group feeds on the Google Apps server.

const APPS_NICKNAME_PATH = '/nickname/2.0'

Path to nickname feeds on the Google Apps server.

const APPS_USER_PATH = '/user/2.0'

Path to user feeds on the Google Apps server.

const AUTH_SERVICE_NAME = 'apps'