API Documentation

Gdata/Gapps/Extension/Login.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: Login.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Gdata_Gapps_Extension_Login

Represents the apps:login element used by the Apps data API. This class is used to describe properties of a user, and is usually contained within instances of Zene_Gdata_Gapps_UserEntry or any other class which is linked to a particular username.

Extends from
\Zend_Gdata_Extension
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Gdata  
subpackage
Gapps  

Properties

Propertyprotectedboolean  $_admin= 'null'

True if the user has administrative rights for this domain, false otherwise.

Default valuenullDetails
Type
boolean
Propertyprotected\boolean.  $_agreedToTerms= 'null'

True if the user has agreed to the terms of service for Google Apps, false otherwise.

Default valuenullDetails
Type
\boolean.
Propertyprotectedboolean  $_changePasswordAtNextLogin= 'null'

True if the user will be required to change their password at their next login, false otherwise.

Default valuenullDetails
Type
boolean
Propertyprotectedstring  $_hashFunctionName= 'null'

Specifies whether the password stored in _password is in cleartext or is an SHA-1 digest of a password. If the password is cleartext, then this should be null. If the password is an SHA-1 digest, then this should be set to 'SHA-1'.

At the time of writing, no other hash functions are supported

Default valuenullDetails
Type
string
Propertyprotectedstring  $_password= 'null'

The password for the user. May be in cleartext or as an SHA-1 digest, depending on the value of _hashFunctionName.

Default valuenullDetails
Type
string
Propertyprotectedstring  $_rootElement= 'login'

The XML element name, including prefix if desired
Default valueloginDetails
Type
string
Propertyprotectedstring  $_rootNamespace= 'apps'

The XML namespace prefix
Default valueappsDetails
Type
string
Propertyprotectedboolean  $_suspended= 'null'

True if this user has been suspended, false otherwise.

Default valuenullDetails
Type
boolean
Propertyprotectedstring  $_username= 'null'

The username for this user. This is used as the user's email address and when logging in to Google Apps-hosted services.

Default valuenullDetails
Type
string

Methods

methodpublic__construct( string $username = null, string $password = null, string $hashFunctionName = null, boolean $admin = null, boolean $suspended = null, boolean $changePasswordAtNextLogin = null, boolean $agreedToTerms = null ) : void

Constructs a new Zend_Gdata_Gapps_Extension_Login object.

Parameters
Name Type Description
$username string

(optional) The username to be used for this login.

$password string

(optional) The password to be used for this login.

$hashFunctionName string

(optional) The name of the hash function used to protect the password, or null if no has function has been applied. As of this writing, the only valid values are 'SHA-1' or null.

$admin boolean

(optional) Whether the user is an administrator or not.

$suspended boolean

(optional) Whether this login is suspended or not.

$changePasswordAtNextLogin boolean

(optional) Whether the user is required to change their password at their next login.

$agreedToTerms boolean

(optional) Whether the user has agreed to the terms of service.

methodpublic__get( string $name ) : void

Magic getter to allow access like $entry->foo to call $entry->getFoo() Alternatively, if no getFoo() is defined, but a $_foo protected variable is defined, this is returned.

Inherited from: \Zend_Gdata_App_Base::__get()

TODO Remove ability to bypass getFoo() methods??

Parameters
Name Type Description
$name string The variable name sought
methodpublic__toString( ) : void

Magic toString method allows using this directly via echo Works best in PHP >= 4.2.0

methodpublicencode( ) : string

Alias for saveXML()

Inherited from: \Zend_Gdata_App_Base::encode()

Can be overridden by children to provide more complex representations of entries.

Returns
Type Description
string Encoded string content
methodpublicflushNamespaceLookupCache( ) : void
static

Flush namespace lookup cache.

Inherited from: \Zend_Gdata_App_Base::flushNamespaceLookupCache()

Empties the namespace lookup cache. Call this function if you have added data to the namespace lookup table that contradicts values that may have been cached during a previous call to lookupNamespace().

methodpublicgetAdmin( ) : boolean

Get the value for this element's admin attribute.

Returns
Type Description
boolean The requested attribute.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
Details
see
\setAdmin  
methodpublicgetAgreedToTerms( ) : boolean

Get the value for this element's agreedToTerms attribute.

Returns
Type Description
boolean The requested attribute.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
Details
see
\setAgreedToTerms  
methodpublicgetChangePasswordAtNextLogin( ) : boolean

Get the value for this element's changePasswordAtNextLogin attribute.

Returns
Type Description
boolean The requested attribute.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
Details
see
\setChangePasswordAtNextLogin  
methodpublicgetDOM( \DOMDocument $doc = null,  $majorVersion = 1,  $minorVersion = null ) : \DOMElement

Retrieves a DOMElement which corresponds to this element and all child properties. This is used to build an entry back into a DOM and eventually XML text for sending to the server upon updates, or for application storage/persistence.

Parameters
Name Type Description
$doc \DOMDocument The DOMDocument used to construct DOMElements
$majorVersion
$minorVersion
Returns
Type Description
\DOMElement The DOMElement representing this element and all child properties.
methodpublicgetExtensionAttributes( ) : array

Returns an array of all extension attributes not transformed into data model properties during parsing of the XML. Each element of the array is a hashed array of the format: array('namespaceUri' => string, 'name' => string, 'value' => string);

Inherited from: \Zend_Gdata_App_Base::getExtensionAttributes()
Returns
Type Description
array All extension attributes
methodpublicgetExtensionElements( ) : array

Returns an array of all elements not matched to data model classes during the parsing of the XML

Inherited from: \Zend_Gdata_App_Base::getExtensionElements()
Returns
Type Description
array All elements not matched to data model classes during parsing
methodpublicgetHashFunctionName( ) : string

Get the value for this element's hashFunctionName attribute.

Returns
Type Description
string The requested attribute.
Details
see
\setHashFunctionName  
methodpublicgetPassword( ) : string

Get the value for this element's password attribute.

Returns
Type Description
string The requested attribute.
Details
see
\setPassword  
methodpublicgetSuspended( ) : boolean

Get the value for this element's suspended attribute.

Returns
Type Description
boolean The requested attribute.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
Details
see
\setSuspended  
methodpublicgetText(  $trim = true ) : string

Returns the child text node of this element This represents any raw text contained within the XML element

Inherited from: \Zend_Gdata_App_Base::getText()
Parameters
Name Type Description
$trim
Returns
Type Description
string Child text node
methodpublicgetUsername( ) : string

Get the value for this element's username attribute.

Returns
Type Description
string The attribute being modified.
Details
see
\setUsername  
methodpublicgetXML( ) : string

Alias for saveXML() returns XML content for this element and all children

Inherited from: \Zend_Gdata_App_Base::getXML()
Returns
Type Description
string XML content
methodpubliclookupNamespace( string $prefix, integer $majorVersion = 1, integer $minorVersion = null ) : string

Get the full version of a namespace prefix

Inherited from: \Zend_Gdata_App_Base::lookupNamespace()

Looks up a prefix (atom:, etc.) in the list of registered namespaces and returns the full namespace URI if available. Returns the prefix, unmodified, if it's not registered.

Parameters
Name Type Description
$prefix string The namespace prefix to lookup.
$majorVersion integer

The major protocol version in effect. Defaults to '1'.

$minorVersion integer

The minor protocol version in effect. Defaults to null (use latest).

Returns
Type Description
string
methodpublicregisterAllNamespaces( array $namespaceArray ) : void

Add an array of namespaces to the registered list.

Inherited from: \Zend_Gdata_App_Base::registerAllNamespaces()

Takes an array in the format of: namespace prefix, namespace URI, major protocol version, minor protocol version and adds them with calls to ->registerNamespace()

Parameters
Name Type Description
$namespaceArray array An array of namespaces.
methodpublicregisterNamespace( string $prefix, string $namespaceUri, integer $majorVersion = 1, integer $minorVersion = 0 ) : void

Add a namespace and prefix to the registered list

Inherited from: \Zend_Gdata_App_Base::registerNamespace()

Takes a prefix and a full namespace URI and adds them to the list of registered namespaces for use by $this->lookupNamespace().

WARNING: Currently, registering a namespace will NOT invalidate any memoized data stored in $_namespaceLookupCache. Under normal use, this behavior is acceptable. If you are adding contradictory data to the namespace lookup table, you must call flushNamespaceLookupCache().

Parameters
Name Type Description
$prefix string The namespace prefix
$namespaceUri string The full namespace URI
$majorVersion integer

The major protocol version in effect. Defaults to '1'.

$minorVersion integer

The minor protocol version in effect. Defaults to null (use latest).

methodpublicsaveXML( ) : string

Converts this element and all children into XML text using getDOM()

Inherited from: \Zend_Gdata_App_Base::saveXML()
Returns
Type Description
string XML content
methodpublicsetAdmin( boolean $value ) : \Zend_Gdata_Gapps_Extension_Login

Set the value for this element's admin attribute. This indicates whether this user is an administrator for this domain.

Parameters
Name Type Description
$value boolean The desired value for this attribute.
Returns
Type Description
\Zend_Gdata_Gapps_Extension_Login Provides a fluent interface.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodpublicsetAgreedToTerms( boolean $value ) : \Zend_Gdata_Gapps_Extension_Login

Set the value for this element's agreedToTerms attribute. This indicates whether this user has agreed to the terms of service.

Parameters
Name Type Description
$value boolean The desired value for this attribute.
Returns
Type Description
\Zend_Gdata_Gapps_Extension_Login Provides a fluent interface.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodpublicsetChangePasswordAtNextLogin( boolean $value ) : \Zend_Gdata_Gapps_Extension_Login

Set the value for this element's changePasswordAtNextLogin attribute.

If true, the user will be forced to set a new password the next time they login.

Parameters
Name Type Description
$value boolean The desired value for this attribute.
Returns
Type Description
\Zend_Gdata_Gapps_Extension_Login Provides a fluent interface.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodpublicsetExtensionAttributes( array $value ) : \Zend_Gdata_App_Base

Sets an array of all extension attributes not transformed into data model properties during parsing of the XML. Each element of the array is a hashed array of the format: array('namespaceUri' => string, 'name' => string, 'value' => string); This can be used to add arbitrary attributes to any data model element

Inherited from: \Zend_Gdata_App_Base::setExtensionAttributes()
Parameters
Name Type Description
$value array All extension attributes
Returns
Type Description
\Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
methodpublicsetExtensionElements( array $value ) : \Zend_Gdata_App_Base

Sets an array of all elements not matched to data model classes during the parsing of the XML. This method can be used to add arbitrary child XML elements to any data model class.

Inherited from: \Zend_Gdata_App_Base::setExtensionElements()
Parameters
Name Type Description
$value array All extension elements
Returns
Type Description
\Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
methodpublicsetHashFunctionName( string $value ) : \Zend_Gdata_Gapps_Extension_Login

Set the value for this element's hashFunctionName attribute. This indicates whether the password supplied with setPassword() is in plaintext or has had a hash function applied to it. If null, plaintext is assumed. As of this writing, the only valid hash function is 'SHA-1'.

Parameters
Name Type Description
$value string The desired value for this attribute.
Returns
Type Description
\Zend_Gdata_Gapps_Extension_Login Provides a fluent interface.
methodpublicsetPassword( string $value ) : \Zend_Gdata_Gapps_Extension_Login

Set the value for this element's password attribute. As of this writing, this can be either be provided as plaintext or hashed using the SHA-1 algorithm for protection. If using a hash function, this must be indicated by calling setHashFunctionName().

Parameters
Name Type Description
$value string The desired value for this attribute.
Returns
Type Description
\Zend_Gdata_Gapps_Extension_Login Provides a fluent interface.
methodpublicsetSuspended( boolean $value ) : \Zend_Gdata_Gapps_Extension_Login

Set the value for this element's suspended attribute. If true, the user will not be able to login to this domain until unsuspended.

Parameters
Name Type Description
$value boolean The desired value for this attribute.
Returns
Type Description
\Zend_Gdata_Gapps_Extension_Login Provides a fluent interface.
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodpublicsetText( string $value ) : \Zend_Gdata_App_Base

Sets the child text node of this element This represents any raw text contained within the XML element

Inherited from: \Zend_Gdata_App_Base::setText()
Parameters
Name Type Description
$value string Child text node
Returns
Type Description
\Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
methodpublicsetUsername( string $value ) : \Zend_Gdata_Gapps_Extension_Login

Set the value for this element's username attribute. This string is used to uniquely identify the user in this domian and is used to form this user's email address.

Parameters
Name Type Description
$value string The desired value for this attribute.
Returns
Type Description
\Zend_Gdata_Gapps_Extension_Login Provides a fluent interface.
methodprotectedtakeAttributeFromDOM( \DOMNode $attribute ) : void

Given a DOMNode representing an attribute, tries to map the data into instance members. If no mapping is defined, the name and value are stored in an array.

Parameters
Name Type Description
$attribute \DOMNode The DOMNode attribute needed to be handled
Throws
Exception Description
\Zend_Gdata_App_InvalidArgumentException
methodprotectedtakeChildFromDOM( \DOMNode $child ) : void

Given a child DOMNode, tries to determine how to map the data into object instance members. If no mapping is defined, Extension_Element objects are created and stored in an array.

Inherited from: \Zend_Gdata_App_Base::takeChildFromDOM()
Parameters
Name Type Description
$child \DOMNode The DOMNode needed to be handled
methodpublictransferFromDOM( \DOMNode $node ) : void

Transfers each child and attribute into member variables.

Inherited from: \Zend_Gdata_App_Base::transferFromDOM()

This is called when XML is received over the wire and the data model needs to be built to represent this XML.

Parameters
Name Type Description
$node \DOMNode

The DOMNode that represents this object's data

methodpublictransferFromXML( string $xml ) : void

Parses the provided XML text and generates data model classes for each know element by turning the XML text into a DOM tree and calling transferFromDOM($element). The first data model element with the same name as $this->_rootElement is used and the child elements are recursively parsed.

Inherited from: \Zend_Gdata_App_Base::transferFromXML()
Parameters
Name Type Description
$xml string The XML text to parse
Documentation was generated by DocBlox 0.13.3.