Back to FeedEntry class

Method removeLink

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

Method removeLink - Source code

/**
 * Method to remove a link from the feed entry object.
 *
 * @param   FeedLink  $link  The link object to remove.
 *
 * @return  FeedEntry
 *
 * @since   3.1.4
 */
public function removeLink(FeedLink $link)
{
    // If the link exists remove it.
    foreach ($this->properties['links'] as $k => $l) {
        if ($l == $link) {
            unset($this->properties['links'][$k]);
            $this->properties['links'] = array_values($this->properties['links']);
            return $this;
        }
    }
    return $this;
}