Feed/Entry/Atom.php
Zend Framework
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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Feed
- Version
- $Id$
\Zend_Feed_Entry_Atom
Package: Zend_Feed
Returns
Throws
Concrete class for working with Atom entries.
- Parent(s)
- \Zend_Feed_Entry_Abstract < \Zend_Feed_Element
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
string $_rootElement = 'entry'
Root XML element for Atom entries.
Default value
'entry'
Details- Type
- string
Methods
delete() : void
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.
ThrowsException | Description |
---|---|
\Zend_Feed_Exception |
link(string $rel = null) : mixed
Easy 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.
ParametersName | Type | Description |
---|---|---|
$rel | string | The "rel" attribute to look for. |
Type | Description |
---|---|
mixed |
save(string $postUri = null) : void
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".
ParametersName | Type | Description |
---|---|---|
$postUri | string | Location to POST for creating new entries. |
Exception | Description |
---|---|
\Zend_Feed_Exception |