Abstract Class Zend_Gdata_App_Base

Description

Abstract class for all XML elements

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /Gdata/App/Base.php (line 38)


	
			
Direct descendents
Class Description
 class Zend_Gdata_Gapps_Error Gdata Gapps Error class. This class is used to represent errors returned within an AppsForYourDomainErrors message received from the Google Apps servers.
Abstract class Zend_Gdata_App_Extension Gdata App extensions
Abstract class Zend_Gdata_App_FeedEntryParent Abstract class for common functionality in entries and feeds
Variable Summary
Method Summary
 static void flushNamespaceLookupCache ()
 Zend_Gdata_App_Base __construct ()
 string encode ()
 DOMElement getDOM ([DOMDocument $doc = null], [ $majorVersion = 1], [ $minorVersion = null])
 string getText ([ $trim = true])
 string getXML ()
 string lookupNamespace (string $prefix, [integer $majorVersion = 1], [integer $minorVersion = null])
 void registerAllNamespaces (array $namespaceArray)
 void registerNamespace (string $prefix, string $namespaceUri, [integer $majorVersion = 1], [integer $minorVersion = 0])
 string saveXML ()
 Zend_Gdata_App_Base setText (string $value)
 void takeAttributeFromDOM (DOMNode $attribute)
 void takeChildFromDOM (DOMNode $child)
 void transferFromDOM (DOMNode $node)
 void transferFromXML (string $xml)
 void __get (string $name)
 void __isset (string $name)
 void __set (string $name,  $val, string $value)
 string __toString ()
 void __unset (string $name)
Variables
static array $_namespaceLookupCache = array() (line 78)
  • var: 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().
  • access: protected
array $_extensionAttributes = array() (line 65)
  • var: Leftover attributes which were not handled
  • access: protected
array $_extensionElements = array() (line 60)
  • var: Leftover elements which were not handled
  • access: protected
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')))
(line 95)

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.

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.

string $_rootElement = null (line 44)
  • var: The XML element name, including prefix if desired
  • access: protected

Redefined in descendants as:
string $_rootNamespace = 'atom' (line 49)
  • var: The XML namespace prefix
  • access: protected

Redefined in descendants as:
string $_rootNamespaceURI = null (line 55)
  • var: The XML namespace URI - takes precedence over lookup up the corresponding URI for $_rootNamespace
  • access: protected
string $_text = null (line 70)
  • var: XML child text node content
  • access: protected
Methods
static flushNamespaceLookupCache (line 442)

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().

  • access: public
static void flushNamespaceLookupCache ()
Constructor __construct (line 111)
  • access: public
Zend_Gdata_App_Base __construct ()

Redefined in descendants as:
encode (line 352)

Alias for saveXML()

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

  • return: Encoded string content
  • access: public
string encode ()

Redefined in descendants as:
getDOM (line 207)

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.

  • return: The DOMElement representing this element and all child properties.
  • access: public
DOMElement getDOM ([DOMDocument $doc = null], [ $majorVersion = 1], [ $minorVersion = null])
  • DOMDocument $doc: The DOMDocument used to construct DOMElements
  • $majorVersion
  • $minorVersion

Redefined in descendants as:
getExtensionAttributes (line 176)

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);

  • return: All extension attributes
  • access: public
array getExtensionAttributes ()
getExtensionElements (line 149)

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

  • return: All elements not matched to data model classes during parsing
  • access: public
array getExtensionElements ()
getText (line 121)

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

  • return: Child text node
  • access: public
string getText ([ $trim = true])
  • $trim
getXML (line 339)

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

  • return: XML content
  • access: public
string getXML ()
lookupNamespace (line 372)

Get the full version of a namespace prefix

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.

  • access: public
string lookupNamespace (string $prefix, [integer $majorVersion = 1], [integer $minorVersion = null])
  • 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).

Redefined in descendants as:
registerAllNamespaces (line 457)

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()

  • access: public
void registerAllNamespaces (array $namespaceArray)
  • array $namespaceArray: An array of namespaces.
registerNamespace (line 426)

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().

  • access: public
void registerNamespace (string $prefix, string $namespaceUri, [integer $majorVersion = 1], [integer $minorVersion = 0])
  • 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 (line 327)

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

  • return: XML content
  • access: public
string saveXML ()
setExtensionAttributes (line 191)

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

  • return: Returns an object of the same type as 'this' to provide a fluent interface.
  • access: public
Zend_Gdata_App_Base setExtensionAttributes (array $value)
  • array $value: All extension attributes
setExtensionElements (line 162)

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.

  • return: Returns an object of the same type as 'this' to provide a fluent interface.
  • access: public
Zend_Gdata_App_Base setExtensionElements (array $value)
  • array $value: All extension elements
setText (line 137)

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

  • return: Returns an object of the same type as 'this' to provide a fluent interface.
  • access: public
Zend_Gdata_App_Base setText (string $value)
  • string $value: Child text node
takeAttributeFromDOM (line 261)

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.

  • access: protected
void takeAttributeFromDOM (DOMNode $attribute)
  • DOMNode $attribute: The DOMNode attribute needed to be handled

Redefined in descendants as:
takeChildFromDOM (line 243)

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.

  • access: protected
void takeChildFromDOM (DOMNode $child)
  • DOMNode $child: The DOMNode needed to be handled

Redefined in descendants as:
transferFromDOM (line 279)

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.

  • access: public
void transferFromDOM (DOMNode $node)
  • DOMNode $node: The DOMNode that represents this object's data

Redefined in descendants as:
transferFromXML (line 298)

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.

  • access: public
void transferFromXML (string $xml)
  • string $xml: The XML text to parse
__get (line 475)

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??

  • access: public
void __get (string $name)
  • string $name: The variable name sought

Redefined in descendants as:
__isset (line 520)

Magic __isset method

  • access: public
void __isset (string $name)
  • string $name
__set (line 501)

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??

  • access: public
void __set (string $name,  $val, string $value)
  • string $name
  • string $value
  • $val
__toString (line 567)

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

  • return: The text representation of this object
  • access: public
string __toString ()

Redefined in descendants as:
__unset (line 550)

Magic __unset method

  • access: public
void __unset (string $name)
  • string $name

Documentation generated on Mon, 21 Jun 2010 15:08:40 -0400 by phpDocumentor 1.4.3