⇦ Back to FeedDocument classMethod addItem
public \Joomla\CMS\Document\FeedDocument
addItem
(\Joomla\CMS\Document\Feed\FeedItem $item)
Adds a FeedItem to the feed.
Parameters
- \Joomla\CMS\Document\Feed\FeedItem $item The feeditem to add to the feed.
Returns
- \Joomla\CMS\Document\FeedDocument instance of $this to allow chaining
Since
Method addItem - Source code
/**
* Adds a FeedItem to the feed.
*
* @param FeedItem $item The feeditem to add to the feed.
*
* @return FeedDocument instance of $this to allow chaining
*
* @since 1.7.0
*/
public function addItem(FeedItem $item)
{
$item->source = $this->link;
$this->items[] = $item;
return $this;
}