Back to AtomParser class

Method processFeedEntry

protected void
processFeedEntry
(\Joomla\CMS\Feed\FeedEntry $entry, \SimpleXMLElement $el)
Method to handle a `<entry>` element for the feed.
Parameters
  • \Joomla\CMS\Feed\FeedEntry $entry The FeedEntry object being built from the parsed feed entry.
  • \SimpleXMLElement $el The current XML element object to handle.
Returns
  • void
Since
  • 3.1.4
Class: AtomParser
Project: Joomla

Method processFeedEntry - Source code

/**
 * Method to handle a `<entry>` element for the feed.
 *
 * @param   FeedEntry          $entry  The FeedEntry object being built from the parsed feed entry.
 * @param   \SimpleXMLElement  $el     The current XML element object to handle.
 *
 * @return  void
 *
 * @since   3.1.4
 */
protected function processFeedEntry(FeedEntry $entry, \SimpleXMLElement $el)
{
    $entry->uri = (string) $el->id;
    $entry->title = $this->inputFilter->clean((string) $el->title, 'html');
    $entry->updatedDate = $this->inputFilter->clean((string) $el->updated, 'html');
    $entry->content = $this->inputFilter->clean((string) $el->summary, 'html');
    if (!$entry->content) {
        $entry->content = $this->inputFilter->clean((string) $el->content, 'html');
    }
    if (filter_var($entry->uri, FILTER_VALIDATE_URL) === false && !\is_null($el->link) && $el->link) {
        $link = $el->link;
        if (\is_array($link)) {
            $link = $this->bestLinkForUri($link);
        }
        $uri = (string) $link['href'];
        if ($uri) {
            $entry->uri = $uri;
        }
    }
}