FeedWriter\Feed::addGenerator PHP Method

addGenerator() public method

Add a channel element indicating the program used to generate the feed.
public addGenerator ( ) : self
return self
    public function addGenerator()
    {
        if ($this->version == Feed::ATOM) {
            $this->setChannelElement('atom:generator', 'FeedWriter', array('uri' => 'https://github.com/mibe/FeedWriter'));
        } else {
            if ($this->version == Feed::RSS2) {
                $this->setChannelElement('generator', 'FeedWriter');
            } else {
                throw new InvalidOperationException('The generator element is not supported in RSS1 feeds.');
            }
        }
        return $this;
    }