Class Horde_Feed_Entry_Atom

Description

Concrete class for working with Atom entries.

Located in /Feed/lib/Horde/Feed/Entry/Atom.php (line 18)

Horde_Xml_Element
   |
   --Horde_Feed_Entry_Base
      |
      --Horde_Feed_Entry_Atom
Variable Summary
Method Summary
 void delete ()
 mixed link ([string $rel = null])
 void save ([string $postUri = null])
Variables
string $_emptyXml = '<atom:entry/>' (line 25)

The XML string for an "empty" Atom entry.

  • access: protected
string $_entryElementName = 'entry' (line 33)

Name of the XML element for Atom entries. Subclasses can override this to something other than "entry" if necessary.

  • access: protected

Inherited Variables

Inherited from Horde_Xml_Element

Horde_Xml_Element::$_appended
Horde_Xml_Element::$_element
Horde_Xml_Element::$_namespaces
Horde_Xml_Element::$_parentElement
Horde_Xml_Element::$_serialized
Methods
delete (line 49)

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.

  • throws: Horde_Feed_Exception If an error occurs, an Horde_Feed_Exception will be thrown.
  • access: public
void delete ()
link (line 158)

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.

  • access: public
mixed link ([string $rel = null])
  • string $rel: The "rel" attribute to look for.
save (line 90)

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

  • throws: Horde_Feed_Exception If an error occurs, a Horde_Feed_Exception will be thrown.
  • access: public
void save ([string $postUri = null])
  • string $postUri: Location to POST for creating new entries.

Inherited Methods

Inherited From Horde_Feed_Entry_Base

 Horde_Feed_Entry_Base::__wakeup()

Inherited From Horde_Xml_Element

 Horde_Xml_Element::__construct()
 Horde_Xml_Element::appendChild()
 Horde_Xml_Element::fromArray()
 Horde_Xml_Element::getDom()
 Horde_Xml_Element::lookupNamespace()
 Horde_Xml_Element::offsetExists()
 Horde_Xml_Element::offsetGet()
 Horde_Xml_Element::offsetSet()
 Horde_Xml_Element::offsetUnset()
 Horde_Xml_Element::registerNamespace()
 Horde_Xml_Element::saveXml()
 Horde_Xml_Element::saveXmlFragment()
 Horde_Xml_Element::setDom()
 Horde_Xml_Element::setParent()
 Horde_Xml_Element::_children()
 Horde_Xml_Element::_ensureAppended()
 Horde_Xml_Element::__call()
 Horde_Xml_Element::__get()
 Horde_Xml_Element::__isset()
 Horde_Xml_Element::__set()
 Horde_Xml_Element::__sleep()
 Horde_Xml_Element::__toString()
 Horde_Xml_Element::__unset()
 Horde_Xml_Element::__wakeup()

Documentation generated on Sun, 30 Jan 2011 05:15:15 +0000 by phpDocumentor 1.4.3