Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Feed_Entry_Atom Class Reference

Public Member Functions

 delete ()
 Delete an atom entry.
 
 save ($postUri=null)
 Save a new or updated Atom entry.
 
 link ($rel=null)
 Easy access to <link> tags keyed by "rel" attributes.
 
- Public Member Functions inherited from Zend_Feed_Entry_Abstract
 __construct ($uri=null, $element=null)
 Zend_Feed_Entry_Abstract constructor.
 
- Public Member Functions inherited from Zend_Feed_Element
 __construct ($element=null)
 Zend_Feed_Element constructor.
 
 getDOM ()
 Get a DOM representation of the element.
 
 setDOM (DOMElement $element)
 Update the object from a DOM element.
 
 setParent (Zend_Feed_Element $element)
 Set the parent element of this object to another Zend_Feed_Element.
 
 saveXml ()
 Get an XML string representation of this element.
 
 saveXmlFragment ()
 Get the XML for only this element.
 
 getEncoding ()
 Get encoding.
 
 setEncoding ($value)
 Set encoding.
 
 __get ($var)
 Map variable access onto the underlying entry representation.
 
 __set ($var, $val)
 Map variable sets onto the underlying entry representation.
 
 __isset ($var)
 Map isset calls onto the underlying entry representation.
 
 __call ($var, $unused)
 Get the value of an element with method syntax.
 
 __unset ($var)
 Remove all children matching $var.
 
 __toString ()
 Returns the nodeValue of this element when this object is used in a string context.
 
 offsetExists ($offset)
 Required by the ArrayAccess interface.
 
 offsetGet ($offset)
 Required by the ArrayAccess interface.
 
 offsetSet ($offset, $value)
 Required by the ArrayAccess interface.
 
 offsetUnset ($offset)
 Required by the ArrayAccess interface.
 

Public Attributes

const CONTENT_TYPE = 'application/atom+xml'
 Content-Type.
 

Protected Attributes

 $_rootElement = 'entry'
 
 $_rootNamespace = 'atom'
 
- Protected Attributes inherited from Zend_Feed_Entry_Abstract
 $_rootElement
 
 $_rootNamespace = null
 
- Protected Attributes inherited from Zend_Feed_Element
 $_element
 
 $_encoding = 'UTF-8'
 
 $_parentElement
 
 $_appended = true
 

Additional Inherited Members

- Protected Member Functions inherited from Zend_Feed_Element
 ensureAppended ()
 Appends this element to its parent if necessary.
 
 _children ($var)
 Finds children with tagnames matching $var.
 

Member Function Documentation

delete ( )

Delete 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.

Returns
void
Exceptions
Zend_Feed_Exception
See Also
Zend_Feed_Exception
Zend_Feed_Exception
link (   $rel = null)

Easy access to <link> tags keyed by "rel" attributes.

If $elt->link() is called with no arguments, we will attempt to return the value of the <link> 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 <link> 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 <link rel="self"> in the entry.

Parameters
string$relThe "rel" attribute to look for.
Returns
mixed
save (   $postUri = null)

Save 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".

Parameters
string$postUriLocation to POST for creating new entries.
Returns
void
Exceptions
Zend_Feed_Exception
See Also
Zend_Feed_Exception
Zend_Feed_Exception
Zend_Feed_Exception
Zend_Feed_Exception
Zend_Feed_Exception
Zend_Feed_Exception

Member Data Documentation

$_rootElement = 'entry'
protected
$_rootNamespace = 'atom'
protected
const CONTENT_TYPE = 'application/atom+xml'

Content-Type.