Back to Feed class

Method removeEntry

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

Method removeEntry - Source code

/**
 * Method to remove an entry from the feed object.
 *
 * @param   FeedEntry  $entry  The entry object to remove.
 *
 * @return  Feed
 *
 * @since   3.1.4
 */
public function removeEntry(FeedEntry $entry)
{
    // If the entry exists remove it.
    foreach ($this->entries as $k => $e) {
        if ($e == $entry) {
            unset($this->entries[$k]);
            $this->entries = array_values($this->entries);
            return $this;
        }
    }
    return $this;
}