Gdata/App/Base.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Gdata
- Subpackage
- App
- Version
- $Id$
\Zend_Gdata_App_Base
- Children
- \Zend_Gdata_App_Extension
- \Zend_Gdata_App_FeedEntryParent
- \Zend_Gdata_Gapps_Error
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

array $_extensionAttributes = array()Leftover attributes which were not handled
array()Details- Type
- array

array $_extensionElements = array()Leftover elements which were not handled
array()Details- Type
- array

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

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')))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
string $_rootElement = nullThe XML element name, including prefix if desired
nullDetails- Type
- string

string $_rootNamespaceURI = nullThe XML namespace URI - takes precedence over lookup up the corresponding URI for $_rootNamespace
nullDetails- Type
- string
Methods

__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.
| 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.
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $val |

__toString() : stringMagic toString method allows using this directly via echo Works best in PHP >= 4.2.0
| Type | Description |
|---|---|
| string | The text representation of this object |

encode() : stringAlias for saveXML()
| Type | Description |
|---|---|
| string | Encoded string content |

flushNamespaceLookupCache() : voidFlush namespace lookup cache.

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 sending to the server upon updates, or 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. |

getExtensionAttributes() : arrayReturns 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);
| 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
| Type | Description |
|---|---|
| array | All elements not matched to data model classes during parsing |

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

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

lookupNamespace(string $prefix, integer $majorVersion = 1, integer $minorVersion = null) : stringGet the full version of a namespace prefix
| Name | Type | Description |
|---|---|---|
| $prefix | string | The namespace prefix to lookup. |
| $majorVersion | integer | The major protocol version in effect. |
| $minorVersion | integer | The minor protocol version in effect. |
| Type | Description |
|---|---|
| string |

registerAllNamespaces(array $namespaceArray) : voidAdd an array of namespaces to the registered list.
| 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
| Name | Type | Description |
|---|---|---|
| $prefix | string | The namespace prefix |
| $namespaceUri | string | The full namespace URI |
| $majorVersion | integer | The major protocol version in effect. |
| $minorVersion | integer | The minor protocol version in effect. |

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

setExtensionAttributes(array $value) : \Zend_Gdata_App_BaseSets 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
| 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. 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. |

setText(string $value) : \Zend_Gdata_App_BaseSets the child text node of this element This represents any raw text contained within the XML element
| 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. 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.
| 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). 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 |