API Documentation

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 license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Gdata  
subpackage
Gapps  
version
$Id: Gapps.php 23775 2011-03-01 17:25:24Z ralph $  

Functions

functionaddMemberToGroup( string $recipientAddress, string $groupId ) : \Zend_Gdata_Gapps_MemberEntry

Add an email address to a group as a member

Parameters
Name Type Description
$recipientAddress string Email address, member id, or group id
$groupId string The unique id of the group
Returns
Type Description
\Zend_Gdata_Gapps_MemberEntry The member entry returned by the server
functionaddOwnerToGroup( string $email, string $groupId ) : \Zend_Gdata_Gapps_OwnerEntry

Add an email as an owner of a group

Parameters
Name Type Description
$email string

Owner's email

$groupId string Group ownership to be checked for
Returns
Type Description
\Zend_Gdata_Gapps_OwnerEntry The OwnerEntry returned by the server
functionaddRecipientToEmailList( string $recipientAddress, string $emailList ) : \Zend_Gdata_Gapps_EmailListRecipientEntry

Add a specified recipient to an existing emailList.

Parameters
Name 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.
Returns
Type Description
\Zend_Gdata_Gapps_EmailListRecipientEntry The recipient entry created by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functioncreateEmailList( string $emailList ) : \Zend_Gdata_Gapps_EmailListEntry

Create a new email list.

Parameters
Name Type Description
$emailList string The name of the email list to be created.
Returns
Type Description
\Zend_Gdata_Gapps_EmailListEntry The email list entry as created on the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functioncreateGroup( string $groupId, string $groupName, string $description = null, string $emailPermission = null ) : \Zend_Gdata_Gapps_GroupEntry

Create a new group.

Parameters
Name 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
Type Description
\Zend_Gdata_Gapps_GroupEntry The group entry as created on the server.
functioncreateNickname( string $username, string $nickname ) : \Zend_Gdata_Gapps_NicknameEntry

Create a nickname for a given user.

Parameters
Name Type Description
$username string The username to which the new nickname should be associated.
$nickname string The new nickname to be created.
Returns
Type Description
\Zend_Gdata_Gapps_NicknameEntry The nickname entry which was created by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functioncreateUser( 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.

Parameters
Name 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.

Returns
Type Description
\Zend_Gdata_Gapps_UserEntry (optional) The new user entry as returned by server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functiondeleteEmailList( string $emailList ) : void

Delete a specified email list.

Parameters
Name Type Description
$emailList string The name of the emailList to be deleted.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functiondeleteGroup( string $groupId ) : void

Delete a group

Parameters
Name Type Description
$groupId string The unique identifier for the group
functiondeleteNickname( string $nickname ) : void

Delete a specified nickname.

Parameters
Name Type Description
$nickname string The name of the nickname to be deleted.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functiondeleteUser( string $username ) : void

Delete a user by username.

Parameters
Name Type Description
$username string The username associated with the user who should be deleted.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionisMember( string $memberId, string $groupId ) : bool

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

Parameters
Name Type Description
$memberId string Member id or group group id
$groupId string Group to be checked for
Returns
Type Description
bool True, if given entity is a member
functionisOwner( string $email, string $groupId ) : bool

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

Parameters
Name Type Description
$email string

Owner's email

$groupId string Group ownership to be checked for
Returns
Type Description
bool True, if given entity is an owner
functionremoveMemberFromGroup( string $memberId, string $groupId ) : void

Remove a member id from a group

Parameters
Name Type Description
$memberId string Member id or group id
$groupId string The unique id of the group
functionremoveOwnerFromGroup( string $email, string $groupId ) : void

Remove email as an owner of a group

Parameters
Name Type Description
$email string

Owner's email

$groupId string The unique identifier for the group
functionremoveRecipientFromEmailList( string $recipientAddress, string $emailList ) : void

Remove a specified recipient from an email list.

Parameters
Name Type Description
$recipientAddress string The recipient to be removed.
$emailList string The list from which the recipient should be removed.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionrestoreUser( string $username ) : \Zend_Gdata_Gapps_UserEntry

Mark a given user as not suspended.

Parameters
Name Type Description
$username string The username associated with the user who should be restored.
Returns
Type Description
\Zend_Gdata_Gapps_UserEntry The UserEntry for the modified user.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveAllEmailLists( ) : \Zend_Gdata_Gapps_EmailListFeed

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
Type Description
\Zend_Gdata_Gapps_EmailListFeed The list of email lists found as Zend_Gdata_Gapps_EmailListEntry objects.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveAllGroups( ) : \Zend_Gdata_Gapps_GroupFeed

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
Type Description
\Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing all groups apart of the domain.
functionretrieveAllMembers( string $groupId ) : \Zend_Gdata_Gapps_MemberFeed

Retrieves all the members of a group

Parameters
Name Type Description
$groupId string The unique id of the group
Returns
Type Description
\Zend_Gdata_Gapps_MemberFeed Collection of MemberEntry objects representing all members apart of the group.
functionretrieveAllNicknames( ) : \Zend_Gdata_Gapps_NicknameFeed

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
Type Description
\Zend_Gdata_Gapps_NicknameFeed Collection of Zend_Gdata_NicknameEntry objects representing all nicknames in the domain.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveAllRecipients(  $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.

Parameters
Name Type Description
$emailList
Returns
Type Description
\Zend_Gdata_Gapps_EmailListRecipientFeed The list of email lists found as Zend_Gdata_Gapps_EmailListRecipientEntry objects.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveAllUsers( ) : \Zend_Gdata_Gapps_UserFeed

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
Type Description
\Zend_Gdata_Gapps_UserFeed Collection of Zend_Gdata_UserEntry objects representing all users in the domain.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveEmailLists(  $recipient ) : \Zend_Gdata_Gapps_EmailListFeed

Retrieve all email lists associated with a recipient.

Parameters
Name Type Description
$recipient
Returns
Type Description
\Zend_Gdata_Gapps_EmailListFeed The list of email lists found as Zend_Gdata_EmailListEntry objects.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveGroup( string $groupId ) : \Zend_Gdata_Gapps_GroupEntry

Retrieves a group based on group id

Parameters
Name Type Description
$groupId string The unique identifier for the group
Returns
Type Description
\Zend_Gdata_Gapps_GroupEntry The group entry as returned by the server.
functionretrieveGroupOwners( string $groupId ) : \Zend_Gdata_Gapps_OwnerFeed

Retrieves all the owners of a group

Parameters
Name Type Description
$groupId string The unique identifier for the group
Returns
Type Description
\Zend_Gdata_Gapps_OwnerFeed Collection of Zend_Gdata_OwnerEntry objects representing all owners apart of the group.
functionretrieveGroups( string $memberId, bool $directOnly = null ) : \Zend_Gdata_Gapps_GroupFeed

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

Parameters
Name Type Description
$memberId string Member username
$directOnly bool

(Optional) If true, members with direct association only will be considered

Returns
Type Description
\Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing all groups member is apart of in the domain.
functionretrieveNickname( string $nickname ) : \Zend_Gdata_Gapps_NicknameEntry

Retrieve the entry for a specified nickname.

Parameters
Name Type Description
$nickname string The nickname to be retrieved.
Returns
Type Description
\Zend_Gdata_Gapps_NicknameEntry The requested nickname entry.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveNicknames( string $username ) : \Zend_Gdata_Gapps_NicknameFeed

Retrieve all nicknames associated with a specific username.

Parameters
Name Type Description
$username string The username whose nicknames should be returned.
Returns
Type Description
\Zend_Gdata_Gapps_NicknameFeed A feed containing all nicknames for the given user, or null if
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrievePageOfEmailLists(  $startNickname = null ) : \Zend_Gdata_Gapps_EmailListFeed

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

Parameters
Name Type Description
$startNickname
Returns
Type Description
\Zend_Gdata_Gapps_EmailListFeed Collection of Zend_Gdata_EmailListEntry objects representing all nicknames in the domain.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrievePageOfGroups( string $startGroup = null ) : \Zend_Gdata_Gapps_GroupFeed

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

Parameters
Name 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.

Returns
Type Description
\Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing the groups in the domain.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrievePageOfMembers( string $groupId, string $startMember = null ) : \Zend_Gdata_Gapps_MemberFeed

Gets page of Members

Parameters
Name 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
Type Description
\Zend_Gdata_Gapps_MemberFeed Collection of Zend_Gdata_MemberEntry objects
functionretrievePageOfNicknames( string $startNickname = null ) : \Zend_Gdata_Gapps_NicknameFeed

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

Parameters
Name 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.

Returns
Type Description
\Zend_Gdata_Gapps_NicknameFeed Collection of Zend_Gdata_NicknameEntry objects representing all nicknames in the domain.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrievePageOfRecipients(  $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.

Parameters
Name Type Description
$emailList
$startRecipient string

(optinal) The address of the first recipient, or null to start with the first recipient in the list.

Returns
Type Description
\Zend_Gdata_Gapps_EmailListRecipientFeed Collection of Zend_Gdata_EmailListRecipientEntry objects representing all recpients in the specified list.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrievePageOfUsers( string $startUsername = null ) : \Zend_Gdata_Gapps_UserFeed

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

Parameters
Name 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.

Returns
Type Description
\Zend_Gdata_Gapps_UserFeed Collection of Zend_Gdata_UserEntry objects representing all users in the domain.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionretrieveUser( string $username ) : \Zend_Gdata_Gapps_UserEntry

Retrieve a user based on their username.

Parameters
Name Type Description
$username string The username to search for.
Returns
Type Description
\Zend_Gdata_Gapps_UserEntry The username to search for, or null if no match found.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
\Zend_Gdata_App_HttpException
functionsuspendUser( string $username ) : \Zend_Gdata_Gapps_UserEntry

Mark a given user as suspended.

Parameters
Name Type Description
$username string The username associated with the user who should be suspended.
Returns
Type Description
\Zend_Gdata_Gapps_UserEntry The UserEntry for the modified user.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
functionupdateGroup( 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

Parameters
Name 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
Type Description
\Zend_Gdata_Gapps_GroupEntry The group entry as updated on the server.
functionupdateUser( 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.

Parameters
Name Type Description
$username string The username whose data will be overwritten.
$userEntry \Zend_Gdata_Gapps_UserEntry The user entry which will be overwritten.
Returns
Type Description
\Zend_Gdata_Gapps_UserEntry The UserEntry returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
Details
see
\Zend_Gdata_App_Entry::save  

\Zend_Gdata_Gapps

Service 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.

Extends from
\Zend_Gdata
category
Zend  
copyright
Copyright (c) 2005-2011 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  
package
Zend_Gdata  
subpackage
Gapps  

Constants

Constant  APPS_BASE_FEED_URI = 'https://apps-apis.google.com/a/feeds'
Constant  AUTH_SERVICE_NAME = 'apps'
Constant  APPS_USER_PATH = '/user/2.0'

Path to user feeds on the Google Apps server.

Constant  APPS_NICKNAME_PATH = '/nickname/2.0'

Path to nickname feeds on the Google Apps server.

Constant  APPS_GROUP_PATH = '/group/2.0'

Path to group feeds on the Google Apps server.

Constant  APPS_EMAIL_LIST_PATH = '/emailList/2.0'

Path to email list feeds on the Google Apps server.

Constant  APPS_EMAIL_LIST_RECIPIENT_POSTFIX = '/recipient'

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

Properties

Propertyprotectedstring  $_domain= 'null'

The domain which is being administered via the Provisioning API.

Default valuenullDetails
Type
string
Propertypublic  $args= ''
Details
Type
Propertypublic  $method= ''
Details
Type
Propertypublicarray  $namespaces= 'array'
static

Namespaces used for Zend_Gdata_Gapps

Default valuearrayDetails
Type
array

Methods

methodpublic__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.

Parameters
Name Type Description
$method string The method name being called
$args array The arguments passed to the call
Throws
Exception Description
\Zend_Gdata_App_Exception
Details
see
\Zend_Gdata_App::__call()  
methodpublic__construct( \Zend_Http_Client $client = null, string $domain = null, string $applicationId = MyCompany-MyApp-1.0 ) : void

Create Gdata_Gapps object

Parameters
Name 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

methodpublicdelete( 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.

Parameters
Name Type Description
$data mixed The Zend_Gdata_App_Entry or URL to delete
$remainingRedirects integer

(optional)

Throws
Exception Description
\Zend_Gdata_App_HttpException
\Zend_Gdata_App_InvalidArgumentException
\Zend_Gdata_Gapps_ServiceException
methodpublicget( 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.

Parameters
Name Type Description
$uri string GET URI
$extraHeaders array

Extra headers to add to the request, as an array of string-based key/value pairs.

Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetBaseUrl( 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.

Parameters
Name Type Description
$domain string

(optional) A fully-qualified domain to use instead of the default domain for this service instance.

Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodpublicgetDomain( ) : 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.

Returns
Type Description
string The domain to be used for this session, or null if not set.
methodpublicgetEmailListEntry( mixed $location ) : \Zend_Gdata_Gapps_EmailListEntry

Retreive a single EmailListEntry object.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_EmailListEntry
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetEmailListFeed( mixed $location = null ) : \Zend_Gdata_Gapps_EmailListFeed

Retreive EmailListFeed object containing multiple EmailListEntry objects.

Parameters
Name Type Description
$location mixed

(optional) The location for the feed, as a URL or Query.

Returns
Type Description
\Zend_Gdata_Gapps_EmailListFeed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetEmailListRecipientEntry( mixed $location ) : \Zend_Gdata_Gapps_EmailListRecipientEntry

Retreive a single EmailListRecipientEntry object.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_EmailListRecipientEntry
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetEmailListRecipientFeed( mixed $location ) : \Zend_Gdata_Gapps_EmailListRecipientFeed

Retreive EmailListRecipientFeed object containing multiple EmailListRecipientEntry objects.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_EmailListRecipientFeed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetEntry( mixed $location,  $className = Zend_Gdata_Entry ) : string|\Zend_Gdata_App_Entry

Retrieve entry as string or object

Inherited from: \Zend_Gdata::getEntry()
Parameters
Name Type Description
$location mixed The location as string or Zend_Gdata_Query
$className
Returns
Type Description
string\Zend_Gdata_App_Entry Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodpublicgetFeed( mixed $location, string $className = Zend_Gdata_Feed ) : string|\Zend_Gdata_App_Feed

Retrieve feed as string or object

Inherited from: \Zend_Gdata::getFeed()
Parameters
Name Type Description
$location mixed The location as string or Zend_Gdata_Query
$className string The class type to use for returning the feed
Returns
Type Description
string\Zend_Gdata_App_Feed Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodpublicgetGroupEntry( mixed $location = null ) : \Zend_Gdata_Gapps_GroupEntry

Retreive a single GroupEntry object.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_GroupEntry
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetGroupFeed( mixed $location = null ) : \Zend_Gdata_Gapps_GroupFeed

Retreive GroupFeed object containing multiple GroupEntry objects.

Parameters
Name Type Description
$location mixed

(optional) The location for the feed, as a URL or Query.

Returns
Type Description
\Zend_Gdata_Gapps_GroupFeed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetGzipEnabled( ) : boolean
static

Get the HTTP override state

Inherited from: \Zend_Gdata_App::getGzipEnabled()
Returns
Type Description
boolean
methodpublicgetHttpClient( ) : \Zend_Http_Client

Get the Zend_Http_Client object used for communication

Inherited from: \Zend_Gdata_App::getHttpClient()
Returns
Type Description
\Zend_Http_Client
methodpublicgetHttpMethodOverride( ) : boolean
static

Get the HTTP override state

Inherited from: \Zend_Gdata_App::getHttpMethodOverride()
Returns
Type Description
boolean
methodpublicgetMajorProtocolVersion( ) : int

Get the major protocol version that is in use.

Inherited from: \Zend_Gdata_App::getMajorProtocolVersion()
Returns
Type Description
int The major protocol version in use.
Details
see
\_majorProtocolVersion  
methodpublicgetMaxRedirects( ) : int
static

Get the maximum number of redirects to follow during HTTP operations

Inherited from: \Zend_Gdata_App::getMaxRedirects()
Returns
Type Description
int Maximum number of redirects to follow
methodpublicgetMemberEntry( mixed $location = null ) : \Zend_Gdata_Gapps_MemberEntry

Retreive a single MemberEntry object.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_MemberEntry
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetMemberFeed( mixed $location = null ) : \Zend_Gdata_Gapps_MemberFeed

Retreive MemberFeed object containing multiple MemberEntry objects.

Parameters
Name Type Description
$location mixed

(optional) The location for the feed, as a URL or Query.

Returns
Type Description
\Zend_Gdata_Gapps_MemberFeed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetMinorProtocolVersion( ) : \(int|\NULL)

Get the minor protocol version that is in use.

Inherited from: \Zend_Gdata_App::getMinorProtocolVersion()
Returns
Type Description
\(int\NULL) The major protocol version in use, or NULL if no minor version is specified.
Details
see
\_minorProtocolVersion  
methodpublicgetNicknameEntry( mixed $location ) : \Zend_Gdata_Gapps_NicknameEntry

Retreive a single NicknameEntry object.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_NicknameEntry
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetNicknameFeed( mixed $location = null ) : \Zend_Gdata_Gapps_NicknameFeed

Retreive NicknameFeed object containing multiple NicknameEntry objects.

Parameters
Name Type Description
$location mixed

(optional) The location for the feed, as a URL or Query.

Returns
Type Description
\Zend_Gdata_Gapps_NicknameFeed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetOwnerEntry( mixed $location = null ) : \Zend_Gdata_Gapps_OwnerEntry

Retreive a single OwnerEntry object.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_OwnerEntry
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetOwnerFeed( mixed $location = null ) : \Zend_Gdata_Gapps_OwnerFeed

Retreive OwnerFeed object containing multiple OwnerEntry objects.

Parameters
Name Type Description
$location mixed

(optional) The location for the feed, as a URL or Query.

Returns
Type Description
\Zend_Gdata_Gapps_OwnerFeed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetStaticHttpClient( ) : \Zend_Http_Client
static

Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used.

Inherited from: \Zend_Gdata_App::getStaticHttpClient()
Returns
Type Description
\Zend_Http_Client
methodpublicgetUserEntry( mixed $location ) : \Zend_Gdata_Gapps_UserEntry

Retreive a single UserEntry object.

Parameters
Name Type Description
$location mixed The location for the feed, as a URL or Query.
Returns
Type Description
\Zend_Gdata_Gapps_UserEntry
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetUserFeed( mixed $location = null ) : \Zend_Gdata_Gapps_UserFeed

Retrieve a UserFeed containing multiple UserEntry objects.

Parameters
Name Type Description
$location mixed

(optional) The location for the feed, as a URL or Query.

Returns
Type Description
\Zend_Gdata_Gapps_UserFeed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicgetVerboseExceptionMessages( ) : boolean
static

Get whether to use verbose exception messages

Inherited from: \Zend_Gdata_App::getVerboseExceptionMessages()

In the case of HTTP errors, use the body of the HTTP response in the exception message.

Returns
Type Description
boolean
methodpublicimport( string $uri, \Zend_Http_Client $client = null, string $className = Zend_Gdata_App_Feed ) : \Zend_Gdata_App_Feed
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
Name 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

Returns
Type Description
\Zend_Gdata_App_Feed
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicimportFile( string $filename, string $className = Zend_Gdata_App_Feed, string $useIncludePath = false ) : \Zend_Gdata_App_Feed
static

Imports a feed from a file located at $filename.

Inherited from: \Zend_Gdata_App::importFile()
Parameters
Name Type Description
$filename string
$className string The class which is used as the return type
$useIncludePath string Whether the include_path should be searched
Returns
Type Description
\Zend_Gdata_App_Feed
Throws
Exception Description
\Zend_Gdata_App_Exception
methodpublicimportString( string $string, string $className = Zend_Gdata_App_Feed,  $majorProtocolVersion = null,  $minorProtocolVersion = null ) : \Zend_Gdata_App_Feed
static

Imports a feed represented by $string.

Inherited from: \Zend_Gdata_App::importString()
Parameters
Name Type Description
$string string
$className string The class which is used as the return type
$majorProtocolVersion
$minorProtocolVersion
Returns
Type Description
\Zend_Gdata_App_Feed
Throws
Exception Description
\Zend_Gdata_App_Exception
methodpublicimportUrl( string $url, string $className = Zend_Gdata_App_Feed, array $extraHeaders = array ) : string|\Zend_Gdata_App_Feed

Imports the specified URL (non-statically).

Inherited from: \Zend_Gdata_App::importUrl()
Parameters
Name Type Description
$url string The URL to import
$className string The class which is used as the return type
$extraHeaders array

Extra headers to add to the request, as an array of string-based key/value pairs.

Returns
Type Description
string\Zend_Gdata_App_Feed Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function.
Throws
Exception Description
\Zend_Gdata_App_Exception
methodpublicinsertEmailList( \Zend_Gdata_Gapps_EmailListEntry $emailList, string $uri = null ) : \Zend_Gdata_Gapps_EmailListEntry

Create a new email list from an EmailListEntry.

Parameters
Name Type Description
$emailList \Zend_Gdata_Gapps_EmailListEntry The email list entry to insert.
$uri string

(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
Type Description
\Zend_Gdata_Gapps_EmailListEntry The inserted email list entry as returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicinsertEmailListRecipient( \Zend_Gdata_Gapps_EmailListRecipientEntry $recipient, string $uri = null ) : \Zend_Gdata_Gapps_EmailListRecipientEntry

Create a new email list recipient from an EmailListRecipientEntry.

Parameters
Name Type Description
$recipient \Zend_Gdata_Gapps_EmailListRecipientEntry The recipient entry to insert.
$uri string

(optional) The URI where the recipient should be uploaded to. If null, the default recipient creation URI for this domain will be used.

Returns
Type Description
\Zend_Gdata_Gapps_EmailListRecipientEntry The inserted recipient entry as returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicinsertEntry( mixed $data, string $uri, string $className = Zend_Gdata_App_Entry, array $extraHeaders = array ) : \Zend_Gdata_App_Entry

Inserts an entry to a given URI and returns the response as a fully formed Entry.

Inherited from: \Zend_Gdata_App::insertEntry()
Parameters
Name Type Description
$data mixed The Zend_Gdata_App_Entry or XML to post
$uri string POST URI
$className string The class of entry to be returned.
$extraHeaders array

Extra headers to add to the request, as an array of string-based key/value pairs.

Returns
Type Description
\Zend_Gdata_App_Entry The entry returned by the service after insertion.
methodpublicinsertGroup( \Zend_Gdata_Gapps_GroupEntry $group, string $uri = null ) : \Zend_Gdata_Gapps_GroupEntry

Create a new group from a GroupEntry.

Parameters
Name Type Description
$group \Zend_Gdata_Gapps_GroupEntry The group entry to insert.
$uri string

(optional) The URI where the group should be uploaded to. If null, the default user creation URI for this domain will be used.

Returns
Type Description
\Zend_Gdata_Gapps_GroupEntry The inserted group entry as returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicinsertMember( \Zend_Gdata_Gapps_MemberEntry $member, string $uri = null ) : \Zend_Gdata_Gapps_MemberEntry

Create a new member from a MemberEntry.

Parameters
Name Type Description
$member \Zend_Gdata_Gapps_MemberEntry The member entry to insert.
$uri string

(optional) The URI where the group should be uploaded to. If null, the default user creation URI for this domain will be used.

Returns
Type Description
\Zend_Gdata_Gapps_MemberEntry The inserted member entry as returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicinsertNickname( \Zend_Gdata_Gapps_NicknameEntry $nickname, string $uri = null ) : \Zend_Gdata_Gapps_NicknameEntry

Create a new nickname from a NicknameEntry.

Parameters
Name Type Description
$nickname \Zend_Gdata_Gapps_NicknameEntry The nickname entry to insert.
$uri string

(optional) The URI where the nickname should be uploaded to. If null, the default nickname creation URI for this domain will be used.

Returns
Type Description
\Zend_Gdata_Gapps_NicknameEntry The inserted nickname entry as returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicinsertOwner( \Zend_Gdata_Gapps_OwnerEntry $owner, string $uri = null ) : \Zend_Gdata_Gapps_OwnerEntry

Create a new group from a OwnerEntry.

Parameters
Name Type Description
$owner \Zend_Gdata_Gapps_OwnerEntry The owner entry to insert.
$uri string

(optional) The URI where the owner should be uploaded to. If null, the default user creation URI for this domain will be used.

Returns
Type Description
\Zend_Gdata_Gapps_OwnerEntry The inserted owner entry as returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicinsertUser( \Zend_Gdata_Gapps_UserEntry $user, string $uri = null ) : \Zend_Gdata_Gapps_UserEntry

Create a new user from a UserEntry.

Parameters
Name Type Description
$user \Zend_Gdata_Gapps_UserEntry The user entry to insert.
$uri string

(optional) The URI where the user should be uploaded to. If null, the default user creation URI for this domain will be used.

Returns
Type Description
\Zend_Gdata_Gapps_UserEntry The inserted user entry as returned by the server.
Throws
Exception Description
\Zend_Gdata_App_Exception
\Zend_Gdata_App_HttpException
\Zend_Gdata_Gapps_ServiceException
methodpublicisAuthenticated( ) : boolean

Determines whether service object is authenticated.

Inherited from: \Zend_Gdata::isAuthenticated()
Returns
Type Description
boolean True if service object is authenticated, false otherwise.
methodpublicperformHttpRequest( string $method, string $url, array $headers = array, string $body = null, string $contentType = null, int $remainingRedirects = null ) : \Zend_Http_Response

Performs a HTTP request using the specified method.

Inherited from: \Zend_Gdata::performHttpRequest()

Overrides the definition in the parent (Zend_Gdata_App) and uses the Zend_Gdata_HttpClient functionality to filter the HTTP requests and responses.

Parameters
Name Type Description
$method string

The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE'

$url string

The URL to which this request is being performed, or null if found in $data

$headers array An associative array of HTTP headers for this request
$body string The body of the HTTP request
$contentType string The value for the content type of the request body
$remainingRedirects int Number of redirects to follow if requests results in one
Returns
Type Description
\Zend_Http_Response The response object
methodpublicpost( 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.

Parameters
Name 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
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Gdata_App_HttpException
\Zend_Gdata_App_InvalidArgumentException
\Zend_Gdata_Gapps_ServiceException
methodpublicprepareRequest( string $method, string $url = null, array $headers = array, mixed $data = null, string $contentTypeOverride = null ) : array

Provides pre-processing for HTTP requests to APP services.

Inherited from: \Zend_Gdata_App::prepareRequest()
  1. Checks the $data element and, if it's an entry, extracts the XML, multipart data, edit link (PUT,DELETE), etc.
  2. If $data is a string, sets the default content-type header as 'application/atom+xml' if it's not already been set.
  3. Adds a x-http-method override header and changes the HTTP method to 'POST' if necessary as per getHttpMethodOverride()
Parameters
Name Type Description
$method string

The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE'

$url string

The URL to which this request is being performed, or null if found in $data

$headers array An associative array of HTTP headers for this request
$data mixed The Zend_Gdata_App_Entry or XML for the body of the request
$contentTypeOverride string The override value for the content type of the request body
Returns
Type Description
array An associative array containing the determined 'method', 'url', 'data', 'headers', 'contentType'
methodpublicput( 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.

Parameters
Name 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
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Gdata_App_HttpException
\Zend_Gdata_App_InvalidArgumentException
\Zend_Gdata_Gapps_ServiceException
methodpublicregisterPackage( string $name ) : void

Adds a Zend Framework package to the $_registeredPackages array.

Inherited from: \Zend_Gdata_App::registerPackage()

This array is searched when using the magic __call method below to instantiante new objects.

Parameters
Name Type Description
$name string

The name of the package (eg Zend_Gdata_App)

methodpublicsetDomain( 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.

Parameters
Name Type Description
$value string The domain to be used for this session.
methodpublicsetGzipEnabled( boolean $enabled = false ) : void
static

Toggle requesting gzip encoded responses

Inherited from: \Zend_Gdata_App::setGzipEnabled()
Parameters
Name Type Description
$enabled boolean Whether or not to enable gzipped responses
methodpublicsetHttpClient( \Zend_Http_Client $client,  $applicationId = MyCompany-MyApp-1.0 ) : \Zend_Gdata_App

Set the Zend_Http_Client object used for communication

Inherited from: \Zend_Gdata_App::setHttpClient()
Parameters
Name Type Description
$client \Zend_Http_Client The client to use for communication
$applicationId
Returns
Type Description
\Zend_Gdata_App Provides a fluent interface
Throws
Exception Description
\Zend_Gdata_App_HttpException
methodpublicsetHttpMethodOverride( boolean $override = true ) : void
static

Toggle using POST instead of PUT and DELETE HTTP methods

Inherited from: \Zend_Gdata_App::setHttpMethodOverride()

Some feed implementations do not accept PUT and DELETE HTTP methods, or they can't be used because of proxies or other measures. This allows turning on using POST where PUT and DELETE would normally be used; in addition, an X-Method-Override header will be sent with a value of PUT or DELETE as appropriate.

Parameters
Name Type Description
$override boolean Whether to override PUT and DELETE with POST.
methodpublicsetMajorProtocolVersion( int $value ) : void

Set the major protocol version that should be used. Values < 1 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.

Inherited from: \Zend_Gdata_App::setMajorProtocolVersion()
Parameters
Name Type Description
$value int The major protocol version to use.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
Details
see
\_majorProtocolVersion  
methodpublicsetMaxRedirects( int $maxRedirects ) : void
static

Set the maximum number of redirects to follow during HTTP operations

Inherited from: \Zend_Gdata_App::setMaxRedirects()
Parameters
Name Type Description
$maxRedirects int Maximum number of redirects to follow
methodpublicsetMinorProtocolVersion( \(int|\NULL) $value ) : void

Set the minor protocol version that should be used. If set to NULL, no minor protocol version will be sent to the server. Values < 0 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.

Inherited from: \Zend_Gdata_App::setMinorProtocolVersion()
Parameters
Name Type Description
$value \(int|\NULL) The minor protocol version to use.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
Details
see
\_minorProtocolVersion  
methodpublicsetStaticHttpClient( \Zend_Http_Client $httpClient ) : void
static

Set the static HTTP client instance

Inherited from: \Zend_Gdata_App::setStaticHttpClient()

Sets the static HTTP client object to use for retrieving the feed.

Parameters
Name Type Description
$httpClient \Zend_Http_Client
methodpublicsetVerboseExceptionMessages( boolean $verbose ) : void
static

Set whether to use verbose exception messages

Inherited from: \Zend_Gdata_App::setVerboseExceptionMessages()

In the case of HTTP errors, use the body of the HTTP response in the exception message.

Parameters
Name Type Description
$verbose boolean Whether to use verbose exception messages
methodpublicthrowServiceExceptionIfDetected( \Zend_Gdata_Exception $e ) : void
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
Name Type Description
$e \Zend_Gdata_Exception The exception to convert.
Throws
Exception Description
\Zend_Gdata_Gapps_ServiceException
mixed
methodpublicupdateEntry( mixed $data, string|null $uri = null, string|null $className = null, array $extraHeaders = array ) : \Zend_Gdata_App_Entry

Update an entry

Inherited from: \Zend_Gdata_App::updateEntry()
Parameters
Name Type Description
$data mixed

Zend_Gdata_App_Entry or XML (w/ID and link rel='edit')

$uri string|null

The URI to send requests to, or null if $data contains the URI.

$className string|null

The name of the class that should be deserialized from the server response. If null, then 'Zend_Gdata_App_Entry' will be used.

$extraHeaders array

Extra headers to add to the request, as an array of string-based key/value pairs.

Returns
Type Description
\Zend_Gdata_App_Entry The entry returned from the server
Throws
Exception Description
\Zend_Gdata_App_Exception
Documentation was generated by DocBlox 0.13.3.