FeedWriter\Feed::makeItems PHP Method

makeItems() private method

Prints formatted feed items
private makeItems ( ) : string
return string The XML of every feed item.
    private function makeItems()
    {
        $out = '';
        foreach ($this->items as $item) {
            $thisItems = $item->getElements();
            // The argument is printed as rdf:about attribute of item in RSS 1.0
            // We're using the link set in the item (which is mandatory) as the about attribute.
            if ($this->version == Feed::RSS1) {
                $out .= $this->startItem($thisItems['link']['content']);
            } else {
                $out .= $this->startItem();
            }
            foreach ($thisItems as $feedItem) {
                $name = $feedItem['name'];
                // Strip all ATOM namespace prefixes from tags when feed is an ATOM feed.
                // Not needed here, because the ATOM namespace name is used as default namespace.
                if ($this->version == Feed::ATOM && strncmp($name, 'atom', 4) == 0) {
                    $name = substr($name, 5);
                }
                $out .= $this->makeNode($name, $feedItem['content'], $feedItem['attributes']);
            }
            $out .= $this->endItem();
        }
        return $out;
    }