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.
category |
Zend |
package |
Zend_Gdata |
subpackage |
Gapps |
copyright |
Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license |
New BSD License |
inherited_from |
\Zend_Gdata_Extension |
Methods
Constructs a new Zend_Gdata_Gapps_Extension_Login object.
__construct(string $username = null
, string $password = null
, string $hashFunctionName = null
, boolean $admin = null
, boolean $suspended = null
, boolean $changePasswordAtNextLogin = null
, boolean $agreedToTerms = null
)
inherited_from |
\Zend_Gdata_Extension::__construct() |
Parameters
$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.
__construct()
__construct()
Inherited
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.
__get(string $name)
Inherited
TODO Remove ability to bypass getFoo() methods??
Parameters
$name
string
The variable name sought
Magic __isset method
__isset(string $name)
Inherited
Magic setter to allow acces like $entry->foo='bar' to call
$entry->setFoo('bar') automatically.
__set(string $name, $val)
Inherited
Alternatively, if no setFoo() is defined, but a $_foo protected variable
is defined, this is returned.
TODO Remove ability to bypass getFoo() methods??
Parameters
$name
string
$val
Magic toString method allows using this directly via echo
Works best in PHP >= 4.2.0
__toString()
Magic toString method allows using this directly via echo
Works best in PHP >= 4.2.0
__toString() : string
Inherited
Returns
string
The text representation of this object
Magic __unset method
__unset(string $name)
Inherited
Alias for saveXML()
encode() : string
Inherited
Can be overridden by children to provide more complex representations
of entries.
Returns
string
Encoded string content
Flush namespace lookup cache.
flushNamespaceLookupCache()
InheritedStatic
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().
Get the value for this element's admin attribute.
getAdmin() : boolean
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
boolean
The requested attribute.
Get the value for this element's agreedToTerms attribute.
getAgreedToTerms() : boolean
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
boolean
The requested attribute.
Get the value for this element's changePasswordAtNextLogin attribute.
getChangePasswordAtNextLogin() : boolean
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
boolean
The requested attribute.
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.
getDOM(\DOMDocument $doc = null
, $majorVersion = 1
, $minorVersion = null
) : \DOMElement
Parameters
$doc
\DOMDocument
The DOMDocument used to construct DOMElements
$majorVersion
$minorVersion
Returns
\DOMElement
The DOMElement representing this element and all
child properties.
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.
getDOM(\DOMDocument $doc = null
, $majorVersion = 1
, $minorVersion = null
) : \DOMElement
Inherited
Parameters
$doc
\DOMDocument
The DOMDocument used to construct DOMElements
$majorVersion
$minorVersion
Returns
\DOMElement
The DOMElement representing this element and all
child properties.
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);
getExtensionAttributes() : array
Inherited
Returns
array
All extension attributes
Returns an array of all elements not matched to data model classes
during the parsing of the XML
getExtensionElements() : array
Inherited
Returns
array
All elements not matched to data model classes during parsing
Get the value for this element's hashFunctionName attribute.
getHashFunctionName() : string
Returns
string
The requested attribute.
Get the value for this element's password attribute.
getPassword() : string
Returns
string
The requested attribute.
Get the value for this element's suspended attribute.
getSuspended() : boolean
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
boolean
The requested attribute.
Returns the child text node of this element
This represents any raw text contained within the XML element
getText($trim = true
) : string
Inherited
Parameters
$trim
Returns
string
Child text node
Get the value for this element's username attribute.
getUsername() : string
Returns
string
The attribute being modified.
Alias for saveXML() returns XML content for this element and all
children
getXML() : string
Inherited
Returns
string
XML content
Get the full version of a namespace prefix
lookupNamespace(string $prefix, integer $majorVersion = 1
, integer $minorVersion = null
) : string
Inherited
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
$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
string
Add an array of namespaces to the registered list.
registerAllNamespaces(array $namespaceArray) : void
Inherited
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
$namespaceArray
array
An array of namespaces.
Add a namespace and prefix to the registered list
registerNamespace(string $prefix, string $namespaceUri, integer $majorVersion = 1
, integer $minorVersion = 0
) : void
Inherited
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
$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).
Converts this element and all children into XML text using getDOM()
saveXML() : string
Inherited
Returns
string
XML content
Set the value for this element's admin attribute. This indicates
whether this user is an administrator for this domain.
setAdmin(boolean $value) : \Zend_Gdata_Gapps_Extension_Login
Parameters
$value
boolean
The desired value for this attribute.
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
\Zend_Gdata_Gapps_Extension_Login
Provides a fluent interface.
Set the value for this element's agreedToTerms attribute. This
indicates whether this user has agreed to the terms of service.
setAgreedToTerms(boolean $value) : \Zend_Gdata_Gapps_Extension_Login
Parameters
$value
boolean
The desired value for this attribute.
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
\Zend_Gdata_Gapps_Extension_Login
Provides a fluent interface.
Set the value for this element's changePasswordAtNextLogin attribute.
setChangePasswordAtNextLogin(boolean $value) : \Zend_Gdata_Gapps_Extension_Login
If true, the user will be forced to set a new password the next
time they login.
Parameters
$value
boolean
The desired value for this attribute.
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
\Zend_Gdata_Gapps_Extension_Login
Provides a fluent interface.
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
setExtensionAttributes(array $value) : \Zend_Gdata_App_Base
Inherited
Parameters
$value
array
All extension attributes
Returns
\Zend_Gdata_App_Base
Returns an object of the same type as 'this' to provide a fluent interface.
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.
setExtensionElements(array $value) : \Zend_Gdata_App_Base
Inherited
Parameters
$value
array
All extension elements
Returns
\Zend_Gdata_App_Base
Returns an object of the same type as 'this' to provide a fluent interface.
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'.
setHashFunctionName(string $value) : \Zend_Gdata_Gapps_Extension_Login
Parameters
$value
string
The desired value for this attribute.
Returns
\Zend_Gdata_Gapps_Extension_Login
Provides a fluent interface.
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().
setPassword(string $value) : \Zend_Gdata_Gapps_Extension_Login
Parameters
$value
string
The desired value for this attribute.
Returns
\Zend_Gdata_Gapps_Extension_Login
Provides a fluent interface.
Set the value for this element's suspended attribute. If true, the
user will not be able to login to this domain until unsuspended.
setSuspended(boolean $value) : \Zend_Gdata_Gapps_Extension_Login
Parameters
$value
boolean
The desired value for this attribute.
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
Returns
\Zend_Gdata_Gapps_Extension_Login
Provides a fluent interface.
Sets the child text node of this element
This represents any raw text contained within the XML element
setText(string $value) : \Zend_Gdata_App_Base
Inherited
Parameters
$value
string
Child text node
Returns
\Zend_Gdata_App_Base
Returns an object of the same type as 'this' to provide a fluent interface.
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.
setUsername(string $value) : \Zend_Gdata_Gapps_Extension_Login
Parameters
$value
string
The desired value for this attribute.
Returns
\Zend_Gdata_Gapps_Extension_Login
Provides a fluent interface.
Transfers each child and attribute into member variables.
transferFromDOM(\DOMNode $node)
Inherited
This is called when XML is received over the wire and the data
model needs to be built to represent this XML.
Parameters
$node
\DOMNode
The DOMNode that represents this object's data
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.
transferFromXML(string $xml)
Inherited
Parameters
$xml
string
The XML text to parse
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.
takeAttributeFromDOM(\DOMNode $attribute)
Parameters
$attribute
\DOMNode
The DOMNode attribute needed to be handled
Exceptions
\Zend_Gdata_App_InvalidArgumentException |
|
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.
takeAttributeFromDOM(\DOMNode $attribute)
Inherited
Parameters
$attribute
\DOMNode
The DOMNode attribute needed to be handled
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.
takeChildFromDOM(\DOMNode $child)
Inherited
Parameters
$child
\DOMNode
The DOMNode needed to be handled
Properties
True if the user has administrative rights for this domain, false
otherwise.
$_admin : boolean
True if the user has agreed to the terms of service for Google Apps,
false otherwise.
$_agreedToTerms : \boolean.
True if the user will be required to change their password at
their next login, false otherwise.
$_changePasswordAtNextLogin : boolean
Leftover attributes which were not handled
$_extensionAttributes : array
Leftover elements which were not handled
$_extensionElements : array
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'.
$_hashFunctionName : string
At the time of writing, no other hash functions are supported
Memoized results from calls to lookupNamespace() to avoid
expensive calls to getGreatestBoundedValue(). The key is in the
form 'prefix-majorVersion-minorVersion', and the value is the
output from getGreatestBoundedValue().
$_namespaceLookupCache : array
Static
List of namespaces, as a three-dimensional array. The first dimension
represents the namespace prefix, the second dimension represents the
minimum major protocol version, and the third dimension is the minimum
minor protocol version. Null keys are NOT allowed.
$_namespaces : array
Default
array('atom' => array(1 => array(0 => 'http://www.w3.org/2005/Atom')), 'app' => array(1 => array(0 => 'http://purl.org/atom/app#'), 2 => array(0 => 'http://www.w3.org/2007/app')))
When looking up a namespace for a given prefix, the greatest version
number (both major and minor) which is less than the effective version
should be used.
The password for the user. May be in cleartext or as an SHA-1
digest, depending on the value of _hashFunctionName.
$_password : string
$_rootElement
$_rootElement
The XML element name, including prefix if desired
$_rootElement : string
$_rootNamespace
$_rootNamespace
inherited_from |
\Zend_Gdata_Extension::_rootNamespace |
The XML namespace prefix
$_rootNamespace : string
The XML namespace URI - takes precedence over lookup up the
corresponding URI for $_rootNamespace
$_rootNamespaceURI : string
True if this user has been suspended, false otherwise.
$_suspended : boolean
XML child text node content
$_text : string
The username for this user. This is used as the user's email address
and when logging in to Google Apps-hosted services.
$_username : string