Feed/Entry/Atom.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_Feed
- Version
- $Id: Atom.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Feed_Entry_Atom
- Parent(s)
- \Zend_Feed_Entry_Abstract < \Zend_Feed_Element
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

boolean $_appended = truetrueDetails- Type
- boolean
- Inherited_from
- \Zend_Feed_Element::$$_appended
- Inherited_from
- \Zend_Feed_Entry_Abstract::$$_appended

\DOMElement $_element- Type
- \DOMElement
- Inherited_from
- \Zend_Feed_Element::$$_element
- Inherited_from
- \Zend_Feed_Entry_Abstract::$$_element

string $_encoding = 'UTF-8'Character encoding to utilize
'UTF-8'Details- Type
- string
- Inherited_from
- \Zend_Feed_Element::$$_encoding
- Inherited_from
- \Zend_Feed_Entry_Abstract::$$_encoding

\Zend_Feed_Element $_parentElement- Type
- \Zend_Feed_Element
- Inherited_from
- \Zend_Feed_Element::$$_parentElement
- Inherited_from
- \Zend_Feed_Entry_Abstract::$$_parentElement

string $_rootElement = 'entry'Subclasses must define this to a non-null value.
'entry'Details- Type
- string
Methods

__call(string $var, mixed $unused) : mixedGet the value of an element with method syntax.
Inherited from: \Zend_Feed_Element::__call()\Zend_Feed_Entry_Abstract::__call()Map method calls to get the string value of the requested element. If there are multiple elements that match, this will return an array of those objects.
| Name | Type | Description |
|---|---|---|
| $var | string | The element to get the string value of. |
| $unused | mixed | This parameter is not used. |
| Type | Description |
|---|---|
| mixed | The node's value, null, or an array of nodes. |

__construct(string $uri = null, \SimpleXMLElement | \DOMNode | string $element = null) : voidZend_Feed_Entry_Abstract constructor
Inherited from: \Zend_Feed_Entry_Abstract::__construct()The Zend_Feed_Entry_Abstract constructor takes the URI of the feed the entry is part of, and optionally an XML construct (usually a SimpleXMLElement, but it can be an XML string or a DOMNode as well) that contains the contents of the entry.
| Name | Type | Description |
|---|---|---|
| $uri | string | |
| $element | \SimpleXMLElement | \DOMNode | string |
| Exception | Description |
|---|---|
| \Zend_Feed_Exception |

__get(string $var) : mixedMap variable access onto the underlying entry representation.
Inherited from: \Zend_Feed_Element::__get()\Zend_Feed_Entry_Abstract::__get()Get-style access returns a Zend_Feed_Element representing the child element accessed. To get string values, use method syntax with the __call() overriding.
| Name | Type | Description |
|---|---|---|
| $var | string | The property to access. |
| Type | Description |
|---|---|
| mixed |

__isset(string $var) : booleanMap isset calls onto the underlying entry representation.
Inherited from: \Zend_Feed_Element::__isset()\Zend_Feed_Entry_Abstract::__isset()| Name | Type | Description |
|---|---|---|
| $var | string |
| Type | Description |
|---|---|
| boolean |

__set(string $var, string $val) : voidMap variable sets onto the underlying entry representation.
Inherited from: \Zend_Feed_Element::__set()\Zend_Feed_Entry_Abstract::__set()| Name | Type | Description |
|---|---|---|
| $var | string | The property to change. |
| $val | string | The property's new value. |
| Exception | Description |
|---|---|
| \Zend_Feed_Exception |

__toString() : stringReturns the nodeValue of this element when this object is used in a string context.
Inherited from: \Zend_Feed_Element::__toString()\Zend_Feed_Entry_Abstract::__toString()| Type | Description |
|---|---|
| string |

__unset(string $var) : voidRemove all children matching $var.
Inherited from: \Zend_Feed_Element::__unset()\Zend_Feed_Entry_Abstract::__unset()| Name | Type | Description |
|---|---|---|
| $var | string |

_children(string $var) : arrayFinds children with tagnames matching $var
Inherited from: \Zend_Feed_Element::_children()\Zend_Feed_Entry_Abstract::_children()Similar to SimpleXML's children() method.
| Name | Type | Description |
|---|---|---|
| $var | string | Tagname to match, can be either namespace:tagName or just tagName. |
| Type | Description |
|---|---|
| array |

delete() : voidDelete an atom entry.
Delete tries to delete this entry from its feed. If the entry does not contain a link rel="edit", we throw an error (either the entry does not yet exist or this is not an editable feed). If we have a link rel="edit", we do the empty-body HTTP DELETE to that URI and check for a response of 2xx. Usually the response would be 204 No Content, but the Atom Publishing Protocol permits it to be 200 OK.
| Exception | Description |
|---|---|
| \Zend_Feed_Exception |

ensureAppended() : voidAppends this element to its parent if necessary.
Inherited from: \Zend_Feed_Element::ensureAppended()\Zend_Feed_Entry_Abstract::ensureAppended()
getDOM() : \DOMDocumentGet a DOM representation of the element
Inherited from: \Zend_Feed_Element::getDOM()\Zend_Feed_Entry_Abstract::getDOM()Returns the underlying DOM object, which can then be manipulated with full DOM methods.
| Type | Description |
|---|---|
| \DOMDocument |

getEncoding() : stringGet encoding
Inherited from: \Zend_Feed_Element::getEncoding()\Zend_Feed_Entry_Abstract::getEncoding()| Type | Description |
|---|---|
| string |

link(string $rel = null) : mixedEasy access to tags keyed by "rel" attributes.
If $elt->link() is called with no arguments, we will attempt to return the value of the tag(s) like all other method-syntax attribute access. If an argument is passed to link(), however, then we will return the "href" value of the first tag that has a "rel" attribute matching $rel:
$elt->link(): returns the value of the link tag. $elt->link('self'): returns the href from the first in the entry.
| Name | Type | Description |
|---|---|---|
| $rel | string | The "rel" attribute to look for. |
| Type | Description |
|---|---|
| mixed |

offsetExists(string $offset) : booleanRequired by the ArrayAccess interface.
Inherited from: \Zend_Feed_Element::offsetExists()\Zend_Feed_Entry_Abstract::offsetExists()| Name | Type | Description |
|---|---|---|
| $offset | string |
| Type | Description |
|---|---|
| boolean |

offsetGet(string $offset) : stringRequired by the ArrayAccess interface.
Inherited from: \Zend_Feed_Element::offsetGet()\Zend_Feed_Entry_Abstract::offsetGet()| Name | Type | Description |
|---|---|---|
| $offset | string |
| Type | Description |
|---|---|
| string |

offsetSet(string $offset, string $value) : stringRequired by the ArrayAccess interface.
Inherited from: \Zend_Feed_Element::offsetSet()\Zend_Feed_Entry_Abstract::offsetSet()| Name | Type | Description |
|---|---|---|
| $offset | string | |
| $value | string |
| Type | Description |
|---|---|
| string |

offsetUnset(string $offset) : booleanRequired by the ArrayAccess interface.
Inherited from: \Zend_Feed_Element::offsetUnset()\Zend_Feed_Entry_Abstract::offsetUnset()| Name | Type | Description |
|---|---|---|
| $offset | string |
| Type | Description |
|---|---|
| boolean |

save(string $postUri = null) : voidSave a new or updated Atom entry.
Save is used to either create new entries or to save changes to existing ones. If we have a link rel="edit", we are changing an existing entry. In this case we re-serialize the entry and PUT it to the edit URI, checking for a 200 OK result.
For posting new entries, you must specify the $postUri parameter to save() to tell the object where to post itself. We use $postUri and POST the serialized entry there, checking for a 201 Created response. If the insert is successful, we then parse the response from the POST to get any values that the server has generated: an id, an updated time, and its new link rel="edit".
| Name | Type | Description |
|---|---|---|
| $postUri | string | Location to POST for creating new entries. |
| Exception | Description |
|---|---|
| \Zend_Feed_Exception |

saveXml() : stringGet an XML string representation of this element
Inherited from: \Zend_Feed_Element::saveXml()\Zend_Feed_Entry_Abstract::saveXml()Returns a string of this element's XML, including the XML prologue.
| Type | Description |
|---|---|
| string |

saveXmlFragment() : stringGet the XML for only this element
Inherited from: \Zend_Feed_Element::saveXmlFragment()\Zend_Feed_Entry_Abstract::saveXmlFragment()Returns a string of this element's XML without prologue.
| Type | Description |
|---|---|
| string |

setDOM(\DOMElement $element) : voidUpdate the object from a DOM element
Inherited from: \Zend_Feed_Element::setDOM()\Zend_Feed_Entry_Abstract::setDOM()Take a DOMElement object, which may be originally from a call to getDOM() or may be custom created, and use it as the DOM tree for this Zend_Feed_Element.
| Name | Type | Description |
|---|---|---|
| $element | \DOMElement |

setEncoding(string $value) : \Zend_Feed_ElementSet encoding
Inherited from: \Zend_Feed_Element::setEncoding()\Zend_Feed_Entry_Abstract::setEncoding()| Name | Type | Description |
|---|---|---|
| $value | string | Encoding to use |
| Type | Description |
|---|---|
| \Zend_Feed_Element |

setParent(\Zend_Feed_Element $element) : voidSet the parent element of this object to another Zend_Feed_Element.
Inherited from: \Zend_Feed_Element::setParent()\Zend_Feed_Entry_Abstract::setParent()| Name | Type | Description |
|---|---|---|
| $element | \Zend_Feed_Element |