Back to FeedFactory class

Method _fetchFeedParser

private \Joomla\CMS\Feed\FeedParser
_fetchFeedParser
(mixed $type, \XMLReader $reader)
Method to return a new JFeedParser object based on the registered parsers and a given type.
Parameters
  • string $type The name of parser to return.
  • \XMLReader $reader The XMLReader instance for the feed.
Returns
  • \Joomla\CMS\Feed\FeedParser
Since
  • 3.1.4
-
  • \LogicException
Class: FeedFactory
Project: Joomla

Method _fetchFeedParser - Source code

/**
 * Method to return a new JFeedParser object based on the registered parsers and a given type.
 *
 * @param   string      $type    The name of parser to return.
 * @param   \XMLReader  $reader  The XMLReader instance for the feed.
 *
 * @return  FeedParser
 *
 * @since   3.1.4
 * @throws  \LogicException
 */
private function _fetchFeedParser($type, \XMLReader $reader)
{
    // Look for a registered parser for the feed type.
    if (empty($this->parsers[$type])) {
        throw new \LogicException('No registered feed parser for type ' . $type . '.');
    }
    return new $this->parsers[$type]($reader);
}