$elements
$elements :
Collection of feed item elements
Universal Feed Writer
Item class - Used as feed element in Feed class
addElement(string $elementName, string $content, array $attributes = null, boolean $overwrite = FALSE, boolean $allowMultiple = FALSE) : self
Add an element to elements array
string | $elementName | The tag name of an element |
string | $content | The content of tag |
array | $attributes | Attributes (if any) in 'attrName' => 'attrValue' format |
boolean | $overwrite | Specifies if an already existing element is overwritten. |
boolean | $allowMultiple | Specifies if multiple elements of the same name are allowed. |
if the element name is not a string, empty or NULL.
getElements() : array
Return the collection of elements in this feed item
on ATOM feeds if either a content or link element is missing.
on RSS1 feeds if a title or link element is missing.
All elements of this item.
setDate(\DateTime|integer|string $date) : self
Set the 'date' element of the feed item.
The value of the date parameter can be either an instance of the DateTime class, an integer containing a UNIX timestamp or a string which is parseable by PHP's 'strtotime' function.
\DateTime|integer|string | $date | Date which should be used. |
if the given date was not parseable.
addEnclosure(string $url, integer $length, string $type, boolean $multiple = TRUE) : self
Attach a external media to the feed item.
Not supported in RSS 1.0 feeds.
See RFC 4288 for syntactical correct MIME types.
Note that you should avoid the use of more than one enclosure in one item, since some RSS aggregators don't support it.
string | $url | The URL of the media. |
integer | $length | The length of the media. |
string | $type | The MIME type attribute of the media. |
boolean | $multiple | Specifies if multiple enclosures are allowed |
if the length or type parameter is invalid.
if this method is called on RSS1 feeds.
setAuthor(string $author, string|null $email = null, string|null $uri = null) : self
Set the 'author' element of feed item.
Not supported in RSS 1.0 feeds.
string | $author | The author of this item |
string|null | Optional email address of the author |
|
string|null | $uri | Optional URI related to the author |
if the provided email address is syntactically incorrect.
if this method is called on RSS1 feeds.
setId(string $id, boolean $permaLink = false) : self
Set the unique identifier of the feed item
On ATOM feeds, the identifier must begin with an valid URI scheme.
string | $id | The unique identifier of this item |
boolean | $permaLink | The value of the 'isPermaLink' attribute in RSS 2 feeds. |
if the permaLink parameter is not boolean.
if this method is called on RSS1 feeds.