Back to FeedDocument class

Method 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
  • 1.7.0
Class: FeedDocument
Project: Joomla

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;
}