Concrete class for working with Atom entries.

category Zend
package Zend_Feed
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Feed_Entry_Abstract

 Methods

Get the value of an element with method syntax.

__call(string $var, mixed $unused) : mixed
Inherited

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.

Parameters

$var

string

The element to get the string value of.

$unused

mixed

This parameter is not used.

Returns

mixedThe node's value, null, or an array of nodes.

Zend_Feed_Element constructor.

__construct(\DOMElement $element = null) : void
Inherited

Parameters

$element

\DOMElement

The DOM element we're encapsulating.

Map variable access onto the underlying entry representation.

__get(string $var) : mixed
Inherited

Get-style access returns a Zend_Feed_Element representing the child element accessed. To get string values, use method syntax with the __call() overriding.

Parameters

$var

string

The property to access.

Returns

mixed

Map isset calls onto the underlying entry representation.

__isset(string $var) : boolean
Inherited

Parameters

$var

string

Returns

boolean

Map variable sets onto the underlying entry representation.

__set(string $var, string $val) : void
Inherited

Parameters

$var

string

The property to change.

$val

string

The property's new value.

Exceptions

\Zend_Feed_Exception

Returns the nodeValue of this element when this object is used in a string context.

__toString() : string
Inherited

Returns

string

Remove all children matching $var.

__unset(string $var) : void
Inherited

Parameters

$var

string

Delete an atom entry.

delete() : void

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.

Exceptions

\Zend_Feed_Exception

Get a DOM representation of the element

getDOM() : \DOMDocument
Inherited

Returns the underlying DOM object, which can then be manipulated with full DOM methods.

Returns

\DOMDocument

Get encoding

getEncoding() : string
Inherited

Returns

string

Required by the ArrayAccess interface.

offsetExists(string $offset) : boolean
Inherited

Parameters

$offset

string

Returns

boolean

Required by the ArrayAccess interface.

offsetGet(string $offset) : string
Inherited

Parameters

$offset

string

Returns

string

Required by the ArrayAccess interface.

offsetSet(string $offset, string $value) : string
Inherited

Parameters

$offset

string

$value

string

Returns

string

Required by the ArrayAccess interface.

offsetUnset(string $offset) : boolean
Inherited

Parameters

$offset

string

Returns

boolean

Save a new or updated Atom entry.

save(string $postUri = null) : void

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

$postUri

string

Location to POST for creating new entries.

Exceptions

\Zend_Feed_Exception

Get an XML string representation of this element

saveXml() : string
Inherited

Returns a string of this element's XML, including the XML prologue.

Returns

string

Get the XML for only this element

saveXmlFragment() : string
Inherited

Returns a string of this element's XML without prologue.

Returns

string

Update the object from a DOM element

setDOM(\DOMElement $element) : void
Inherited

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.

Parameters

$element

\DOMElement

Set encoding

setEncoding(string $value) : \Zend_Feed_Element
Inherited

Parameters

$value

string

Encoding to use

Returns

\Zend_Feed_Element

Set the parent element of this object to another Zend_Feed_Element.

setParent(\Zend_Feed_Element $element) : void
Inherited

Parameters

$element

\Zend_Feed_Element

Finds children with tagnames matching $var

_children(string $var) : array
Inherited

Similar to SimpleXML's children() method.

Parameters

$var

string

Tagname to match, can be either namespace:tagName or just tagName.

Returns

array

Appends this element to its parent if necessary.

ensureAppended() : void
Inherited

 Properties

 

$_appended

$_appended : boolean

Default

true
 

$_element

$_element : \DOMElement

Default

 

Character encoding to utilize

$_encoding : string

Default

'UTF-8'
 

$_parentElement

$_parentElement : \Zend_Feed_Element

Default

 

Root XML element for Atom entries.

$_rootElement : string

Default

'entry'
inherited_from \Zend_Feed_Entry_Abstract::_rootElement
 

Root XML element for entries. Subclasses must define this to a non-null value.

$_rootElement : string

Default

 

Root namespace for Atom entries.

$_rootNamespace : string

Default

'atom'
inherited_from \Zend_Feed_Entry_Abstract::_rootNamespace
 

Root namespace for entries. Subclasses may define this to a non-null value.

$_rootNamespace : string

Default

null

 Constants

 

Content-Type

CONTENT_TYPE = 'application/atom+xml'