Back to Feed class

Method addEntry

public \Joomla\CMS\Feed\Feed
addEntry
(\Joomla\CMS\Feed\FeedEntry $entry)
Method to add an entry to the feed object.
Parameters
  • \Joomla\CMS\Feed\FeedEntry $entry The entry object to add.
Returns
  • \Joomla\CMS\Feed\Feed
Since
  • 3.1.4
Class: Feed
Project: Joomla

Method addEntry - Source code

/**
 * Method to add an entry to the feed object.
 *
 * @param   FeedEntry  $entry  The entry object to add.
 *
 * @return  Feed
 *
 * @since   3.1.4
 */
public function addEntry(FeedEntry $entry)
{
    // If the new entry already exists then there is nothing to do, so just return.
    foreach ($this->entries as $e) {
        if ($e == $entry) {
            return $this;
        }
    }
    // Add the new entry.
    $this->entries[] = $entry;
    return $this;
}