public function createFeed($name, $rendererName = null)
    {
        $channels = $this->container->getParameter('argentum_feed.channels');

        if (!isset($channels[$name])) {
            throw new \InvalidArgumentException(sprintf('No such feed: %s', $name));
        }

        $channel = $channels[$name];

        $feed = clone $this->getFeed($channel['feed']);
        unset($channel['feed']);

        $renderer = $this->getRenderer($rendererName ?: $channel['renderer']);
        $feed->setRenderer($renderer);
        unset($channel['renderer']);

        if (isset($channel['provider'])) {
            $feed->addFeedableItems($this->fetchProviderItems($channel['provider']));
            unset($channel['provider']);
        }

        $feed->setChannel($channel);

        return $feed;
    }
public function createFeed($name, $rendererName = null)
    {
        $channels = $this->container->getParameter('argentum_feed.channels');

        if (!isset($channels[$name])) {
            throw new \InvalidArgumentException(sprintf('No such feed: %s', $name));
        }

        $channel = $channels[$name];

        $feed = clone $this->getFeed($channel['feed']);
        unset($channel['feed']);

        $renderer = $this->getRenderer($rendererName ?: $channel['renderer']);
        $feed->setRenderer($renderer);
        unset($channel['renderer']);

        if (isset($channel['provider'])) {
            $feed->addFeedableItems($this->fetchProviderItems($channel['provider']));
            unset($channel['provider']);
        }

        $feed->setChannel($channel);

        return $feed;
    }
public function createFeed ( $ name , $ rendererName = null ) { $ channels = $ this -> container -> getParameter ( 'argentum_feed.channels' ) ; if ( ! isset ( $ channels [ $ name ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'No such feed: %s' , $ name ) ) ; } $ channel = $ channels [ $ name ] ; $ feed = clone $ this -> getFeed ( $ channel [ 'feed' ] ) ; unset ( $ channel [ 'feed' ] ) ; $ renderer = $ this -> getRenderer ( $ rendererName ? : $ channel [ 'renderer' ] ) ; $ feed -> setRenderer ( $ renderer ) ; unset ( $ channel [ 'renderer' ] ) ; if ( isset ( $ channel [ 'provider' ] ) ) { $ feed -> addFeedableItems ( $ this -> fetchProviderItems ( $ channel [ 'provider' ] ) ) ; unset ( $ channel [ 'provider' ] ) ; } $ feed -> setChannel ( $ channel ) ; return $ feed ; }
Creates a new feed instance.

@param string $name A predefined channel name
@param string $rendererName A registered renderer name

@return FeedInterface

@throws \InvalidArgumentException
Creates a new feed instance .