Gdata/Gapps/Error.php
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-2012 Zend Technologies USA Inc. (http://www.zend.com) + +
- License
- New BSD License + +
- Package
- Zend_Gdata + +
- Subpackage
- Gapps + +
- Version
- $Id: Error.php 24593 2012-01-05 20:35:02Z matthew $ + +
\Zend_Gdata_Gapps_Error
This class is used to represent errors returned +within an AppsForYourDomainErrors message received from the Google Apps +servers.
+ +Several different errors may be represented by this class, determined by +the error code returned by the server. For a list of error codes +available at the time of this writing, see getErrorCode.
- Parent(s)
- \Zend_Gdata_App_Base
- Category
- Zend + +
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + +
- License
- New BSD License + +
Constants
Properties

array $_extensionAttributes = array()Leftover attributes which were not handled
array()Details- Type
- array
- Inherited_from
- \Zend_Gdata_App_Base::$$_extensionAttributes + +

array $_extensionElements = array()Leftover elements which were not handled
array()Details- Type
- array
- Inherited_from
- \Zend_Gdata_App_Base::$$_extensionElements + +

array $_namespaceLookupCache = array()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().
+array()Details- Type
- array
- Inherited_from
- \Zend_Gdata_App_Base::$$_namespaceLookupCache + +

array $_namespaces = 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')))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.
+ +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.
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')))Details- Type
- array
- Inherited_from
- \Zend_Gdata_App_Base::$$_namespaces + +
- See
- \lookupNamespace() + +
- See
- \registerNamespace() + +
- See
- \registerAllNamespaces() + +

string $_rootElement = nullThe XML element name, including prefix if desired
nullDetails- Type
- string
- Inherited_from
- \Zend_Gdata_App_Base::$$_rootElement + +

string $_rootNamespace = 'atom''atom'Details- Type
- string
- Inherited_from
- \Zend_Gdata_App_Base::$$_rootNamespace + +

string $_rootNamespaceURI = nullThe XML namespace URI - takes precedence over lookup up the corresponding URI for $_rootNamespace
+nullDetails- Type
- string
- Inherited_from
- \Zend_Gdata_App_Base::$$_rootNamespaceURI + +

string $_text = nullnullDetails- Type
- string
- Inherited_from
- \Zend_Gdata_App_Base::$$_text + +
Methods

__construct( $errorCode = null, $reason = null, $invalidInput = null) : void| Name | Type | Description |
|---|---|---|
| $errorCode | ||
| $reason | ||
| $invalidInput |

__get(string $name) : voidMagic 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??
| Name | Type | Description |
|---|---|---|
| $name | string | The variable name sought |

__set(string $name, $val) : voidMagic setter to allow acces like $entry->foo='bar' to call +$entry->setFoo('bar') automatically.
Inherited from: + \Zend_Gdata_App_Base::__set()Alternatively, if no setFoo() is defined, but a $_foo protected variable +is defined, this is returned.
+ +TODO Remove ability to bypass getFoo() methods??
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $val |

encode() : stringCan be overridden by children to provide more complex representations +of entries.
| Type | Description |
|---|---|
| string | Encoded string content |

flushNamespaceLookupCache() : voidFlush 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().

getDOM(\DOMDocument $doc = null, $majorVersion = 1, $minorVersion = null) : \DOMElementRetrieves 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 application storage/persistence.
| Name | Type | Description |
|---|---|---|
| $doc | \DOMDocument | The DOMDocument used to construct DOMElements |
| $majorVersion | ||
| $minorVersion |
| Type | Description |
|---|---|
| \DOMElement | The DOMElement representing this element and all + child properties. |

getErrorCode() : integerGet the error code for this exception.
Currently valid values are +available as constants within this class. These values are:
+ +UNKNOWN_ERROR (1000) + USER_DELETED_RECENTLY (1100) + USER_SUSPENDED (1101) + DOMAIN_USER_LIMIT_EXCEEDED (1200) + DOMAIN_ALIAS_LIMIT_EXCEEDED (1201) + DOMAIN_SUSPENDED (1202) + DOMAIN_FEATURE_UNAVAILABLE (1203) + ENTITY_EXISTS (1300) + ENTITY_DOES_NOT_EXIST (1301) + ENTITY_NAME_IS_RESERVED (1302) + ENTITY_NAME_NOT_VALID (1303) + INVALID_GIVEN_NAME (1400) + INVALID_FAMILY_NAME (1401) + INVALID_PASSWORD (1402) + INVALID_USERNAME (1403) + INVALID_HASH_FUNCTION_NAME (1404) + INVALID_HASH_DIGEST_LENGTH (1405) + INVALID_EMAIL_ADDRESS (1406) + INVALID_QUERY_PARAMETER_VALUE (1407) + TOO_MANY_RECIPIENTS_ON_EMAIL_LIST (1500)
+ +Numbers in parenthesis indicate the actual integer value of the +constant. This list should not be treated as exhaustive, as additional +error codes may be added at any time.
+ +For more information about these codes and their meaning, please +see Appendix D of the Google Apps Provisioning API Reference.
| Type | Description |
|---|---|
| integer | The error code returned by the Google Apps server. |
- Link
- Google Apps Provisioning API Reference: Appendix D - Gdata Error Codes + +
- See
- \setErrorCode + +

getExtensionAttributes() : arrayReturns an array of all extension attributes not transformed into data +model properties during parsing of the XML.
Inherited from: + \Zend_Gdata_App_Base::getExtensionAttributes()Each element of the array +is a hashed array of the format: + array('namespaceUri' => string, 'name' => string, 'value' => string);
| Type | Description |
|---|---|
| array | All extension attributes |

getExtensionElements() : arrayReturns an array of all elements not matched to data model classes +during the parsing of the XML
Inherited from: + \Zend_Gdata_App_Base::getExtensionElements()| Type | Description |
|---|---|
| array | All elements not matched to data model classes during parsing |

getInvalidInput() : stringSet the invalid input which caused this exception.
| Type | Description |
|---|---|
| string | The reason this exception occurred. |
- See
- \setInvalidInput + +

getReason() : stringGet human-readable text describing the reason this exception occurred.
| Type | Description |
|---|---|
| string | The reason this exception occurred. |
- See
- \setReason + +

getText( $trim = true) : stringReturns the child text node of this element +This represents any raw text contained within the XML element
Inherited from: + \Zend_Gdata_App_Base::getText()| Name | Type | Description |
|---|---|---|
| $trim |
| Type | Description |
|---|---|
| string | Child text node |

getXML() : stringAlias for saveXML() returns XML content for this element and all +children
Inherited from: + \Zend_Gdata_App_Base::getXML()| Type | Description |
|---|---|
| string | XML content |

lookupNamespace(string $prefix, integer $majorVersion = 1, integer $minorVersion = null) : stringGet 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.
| 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). + |
| Type | Description |
|---|---|
| string |

registerAllNamespaces(array $namespaceArray) : voidAdd 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()
| Name | Type | Description |
|---|---|---|
| $namespaceArray | array | An array of namespaces. |

registerNamespace(string $prefix, string $namespaceUri, integer $majorVersion = 1, integer $minorVersion = 0) : voidAdd 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().
| 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). + |

saveXML() : stringConverts this element and all children into XML text using getDOM()
Inherited from: + \Zend_Gdata_App_Base::saveXML()| Type | Description |
|---|---|
| string | XML content |

setErrorCode(integer $value) : voidSet the error code for this exception.
For more information about +error codes, see getErrorCode.
| Name | Type | Description |
|---|---|---|
| $value | integer | The new value for the error code. |
- See
- \getErrorCode + +

setExtensionAttributes(array $value) : \Zend_Gdata_App_BaseSets an array of all extension attributes not transformed into data +model properties during parsing of the XML.
Inherited from: + \Zend_Gdata_App_Base::setExtensionAttributes()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
| Name | Type | Description |
|---|---|---|
| $value | array | All extension attributes |
| Type | Description |
|---|---|
| \Zend_Gdata_App_Base | Returns an object of the same type as 'this' to provide a fluent interface. |

setExtensionElements(array $value) : \Zend_Gdata_App_BaseSets an array of all elements not matched to data model classes +during the parsing of the XML.
Inherited from: + \Zend_Gdata_App_Base::setExtensionElements()This method can be used to add arbitrary +child XML elements to any data model class.
| Name | Type | Description |
|---|---|---|
| $value | array | All extension elements |
| Type | Description |
|---|---|
| \Zend_Gdata_App_Base | Returns an object of the same type as 'this' to provide a fluent interface. |

setInvalidInput(string $value) : voidSet the invalid input which caused this exception.
| Name | Type | Description |
|---|---|---|
| $value | string | The invalid input that triggered this exception. |
- See
- \getInvalidInput + +

setReason(string $value) : voidSet human-readable text describing the reason this exception occurred.
| Name | Type | Description |
|---|---|---|
| $value | string | The reason this exception occurred. |
- See
- \getReason + +

setText(string $value) : \Zend_Gdata_App_BaseSets the child text node of this element +This represents any raw text contained within the XML element
Inherited from: + \Zend_Gdata_App_Base::setText()| Name | Type | Description |
|---|---|---|
| $value | string | Child text node |
| Type | Description |
|---|---|
| \Zend_Gdata_App_Base | Returns an object of the same type as 'this' to provide a fluent interface. |

takeAttributeFromDOM(\DOMNode $attribute) : voidGiven 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.
| Name | Type | Description |
|---|---|---|
| $attribute | \DOMNode | The DOMNode attribute needed to be handled |

takeChildFromDOM(\DOMNode $child) : voidGiven a child DOMNode, tries to determine how to map the data into +object instance members.
Inherited from: + \Zend_Gdata_App_Base::takeChildFromDOM()If no mapping is defined, Extension_Element +objects are created and stored in an array.
| Name | Type | Description |
|---|---|---|
| $child | \DOMNode | The DOMNode needed to be handled |

transferFromDOM(\DOMNode $node) : voidTransfers 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.
| Name | Type | Description |
|---|---|---|
| $node | \DOMNode | The DOMNode that represents this object's data + |

transferFromXML(string $xml) : voidParses 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).
Inherited from: + \Zend_Gdata_App_Base::transferFromXML()The first data model element with the same +name as $this->_rootElement is used and the child elements are +recursively parsed.
| Name | Type | Description |
|---|---|---|
| $xml | string | The XML text to parse |