⇦ Back to Feed classMethod 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
Since
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;
}