PHP Class Horde_Feed_Entry_Atom, horde

Inheritance: extends Horde_Feed_Entry_Base
Mostra file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_emptyXml string The XML string for an "empty" Atom entry.
$_entryElementName string Name of the XML element for Atom entries. Subclasses can override this to something other than "entry" if necessary.

Public Methods

Method Description
delete ( ) Delete an atom entry.
link ( string $rel = null ) : mixed Easy access to tags keyed by "rel" attributes.
save ( string $postUri = null, array $headers = [] ) Save a new or updated Atom entry.

Method Details

delete() public method

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

save() public method

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".
public save ( string $postUri = null, array $headers = [] )
$postUri string Location to POST for creating new entries.
$headers array Additional headers to transmit while posting.

Property Details

$_emptyXml protected_oe property

The XML string for an "empty" Atom entry.
protected string $_emptyXml
return string

$_entryElementName protected_oe property

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