Zend Framework
1.12
|
Public Member Functions | |
__construct () | |
getText ($trim=true) | |
Returns the child text node of this element This represents any raw text contained within the XML element. | |
setText ($value) | |
Sets the child text node of this element This represents any raw text contained within the XML element. | |
getExtensionElements () | |
Returns an array of all elements not matched to data model classes during the parsing of the XML. | |
setExtensionElements ($value) | |
Sets an array of all elements not matched to data model classes during the parsing of the XML. | |
getExtensionAttributes () | |
Returns an array of all extension attributes not transformed into data model properties during parsing of the XML. | |
setExtensionAttributes ($value) | |
Sets an array of all extension attributes not transformed into data model properties during parsing of the XML. | |
getDOM ($doc=null, $majorVersion=1, $minorVersion=null) | |
Retrieves a DOMElement which corresponds to this element and all child properties. | |
transferFromDOM ($node) | |
Transfers each child and attribute into member variables. | |
transferFromXML ($xml) | |
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). | |
saveXML () | |
Converts this element and all children into XML text using getDOM() | |
getXML () | |
Alias for saveXML() returns XML content for this element and all children. | |
encode () | |
Alias for saveXML() | |
lookupNamespace ($prefix, $majorVersion=1, $minorVersion=null) | |
Get the full version of a namespace prefix. | |
registerNamespace ($prefix, $namespaceUri, $majorVersion=1, $minorVersion=0) | |
Add a namespace and prefix to the registered list. | |
registerAllNamespaces ($namespaceArray) | |
Add an array of namespaces to the registered list. | |
__get ($name) | |
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. | |
__set ($name, $val) | |
Magic setter to allow acces like $entry->foo='bar' to call $entry->setFoo('bar') automatically. | |
__isset ($name) | |
Magic __isset method. | |
__unset ($name) | |
Magic __unset method. | |
__toString () | |
Magic toString method allows using this directly via echo Works best in PHP >= 4.2.0. | |
Static Public Member Functions | |
static | flushNamespaceLookupCache () |
Flush namespace lookup cache. | |
Protected Member Functions | |
takeChildFromDOM ($child) | |
Given a child DOMNode, tries to determine how to map the data into object instance members. | |
takeAttributeFromDOM ($attribute) | |
Given a DOMNode representing an attribute, tries to map the data into instance members. | |
Protected Attributes | |
$_rootElement = null | |
$_rootNamespace = 'atom' | |
$_rootNamespaceURI = null | |
$_extensionElements = array() | |
$_extensionAttributes = array() | |
$_text = null | |
$_namespaces | |
Static Protected Attributes | |
static | $_namespaceLookupCache = array() |
__construct | ( | ) |
__get | ( | $name | ) |
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.
TODO Remove ability to bypass getFoo() methods??
string | $name | The variable name sought |
__isset | ( | $name | ) |
Magic __isset method.
string | $name |
__set | ( | $name, | |
$val | |||
) |
Magic setter to allow acces like $entry->foo='bar' to call $entry->setFoo('bar') automatically.
Alternatively, if no setFoo() is defined, but a $_foo protected variable is defined, this is returned.
TODO Remove ability to bypass getFoo() methods??
string | $name | |
string | $value |
__toString | ( | ) |
Magic toString method allows using this directly via echo Works best in PHP >= 4.2.0.
__unset | ( | $name | ) |
Magic __unset method.
string | $name |
encode | ( | ) |
Alias for saveXML()
Can be overridden by children to provide more complex representations of entries.
|
static |
Flush namespace lookup cache.
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 | ( | $doc = null , |
|
$majorVersion = 1 , |
|||
$minorVersion = null |
|||
) |
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.
DOMDocument | $doc | The DOMDocument used to construct DOMElements |
getExtensionAttributes | ( | ) |
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);
getExtensionElements | ( | ) |
Returns an array of all elements not matched to data model classes during the parsing of the XML.
getText | ( | $trim = true | ) |
Returns the child text node of this element This represents any raw text contained within the XML element.
getXML | ( | ) |
Alias for saveXML() returns XML content for this element and all children.
array Memoized results from calls to lookupNamespace | ( | $prefix, | |
$majorVersion = 1 , |
|||
$minorVersion = null |
|||
) |
Get the full version of a namespace prefix.
expensive calls to getGreatestBoundedValue().
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.
string | $prefix | The namespace prefix to lookup. |
integer | $majorVersion | The major protocol version in effect. Defaults to '1'. |
integer | $minorVersion | The minor protocol version in effect. Defaults to null (use latest). |
The key is in the form 'prefix-majorVersion-minorVersion', and the value is the output from getGreatestBoundedValue().
registerAllNamespaces | ( | $namespaceArray | ) |
Add an array of namespaces to the registered list.
Takes an array in the format of: namespace prefix, namespace URI, major protocol version, minor protocol version and adds them with calls to ->registerNamespace()
array | $namespaceArray | An array of namespaces. |
registerNamespace | ( | $prefix, | |
$namespaceUri, | |||
$majorVersion = 1 , |
|||
$minorVersion = 0 |
|||
) |
Add a namespace and prefix to the registered list.
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().
string | $prefix | The namespace prefix |
string | $namespaceUri | The full namespace URI |
integer | $majorVersion | The major protocol version in effect. Defaults to '1'. |
integer | $minorVersion | The minor protocol version in effect. Defaults to null (use latest). |
saveXML | ( | ) |
Converts this element and all children into XML text using getDOM()
setExtensionAttributes | ( | $value | ) |
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
array | $value | All extension attributes |
setExtensionElements | ( | $value | ) |
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.
array | $value | All extension elements |
setText | ( | $value | ) |
Sets the child text node of this element This represents any raw text contained within the XML element.
string | $value | Child text node |
|
protected |
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.
DOMNode | $attribute | The DOMNode attribute needed to be handled |
|
protected |
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.
DOMNode | $child | The DOMNode needed to be handled |
transferFromDOM | ( | $node | ) |
Transfers each child and attribute into member variables.
This is called when XML is received over the wire and the data model needs to be built to represent this XML.
DOMNode | $node | The DOMNode that represents this object's data |
transferFromXML | ( | $xml | ) |
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.
string | $xml | The XML text to parse |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |