Renderer/AtomRenderer.php
private function writeItem(XMLManager $xml, ItemInterface $item)
    {
        $nodeItem = $this->createItem($xml);
        $xml->addTextNode('title', $item->getFeedTitle(), $nodeItem);

        $type = $this->itemHas($item, 'getAtomContentType') ? $item->getAtomContentType() : null;
        $content = $xml->addTextNode('content', $type === 'xhtml' ? $item->getFeedDescription() : htmlentities($item->getFeedDescription(), ENT_COMPAT, 'UTF-8'), $nodeItem);
        if(!empty($type)){
            $content->setAttribute('type', $type);
        }
        if($this->itemHas($item, 'getAtomContentLanguage')){
            $content->setAttribute('xml:lang', $item->getAtomContentLanguage());
        }


        $id=$item->getFeedId();
        if(empty($id))
        throw new \InvalidArgumentException('The method « getFeedId » CAN\'T return an empty value.');
        $xml->addTextNode('id', $id, $nodeItem);


        $xml->addTextNode('published', $item->getFeedDate()->format(\DateTime::ATOM), $nodeItem);

        $date = new \DateTime();
        $xml->addTextNode('updated', $item->getFeedDate()->format(\DateTime::ATOM), $nodeItem);

        if ($this->itemHas($item, 'getFeedAuthor')) {
            if ($author = $item->getFeedAuthor()) {
                $authorNode = $this->createAuthor($xml, $author);
                $nodeItem->appendChild($authorNode);
            }
        }
        if ($this->itemHas($item, 'getSummary')) {
            $type = $this->itemHas($item, 'getAtomSummaryType') ? $item->getAtomSummaryType() : null;
            $summary = $xml->addTextNode('category', $type === 'xhtml' ? $item->getFeedDescription() : htmlentities($item->getFeedSummary(), ENT_COMPAT, 'UTF-8'), $nodeItem);
            if(!empty($type)){
                $summary->setAttribute('type', $type);
            }
        }
        if ($this->itemHas($item, 'getAtomContributors')) {
            if ($contributors = $item->getAtomContributors($item)) {
                foreach($contributors as $contributor) {
                    $contribNode = $this->createContributor($xml, $contributor);
                    $nodeItem->appendChild($contribNode);
                }
            }
        }

        $routes = $item->getFeedRoutes();
        foreach($routes as $route) {
            $linkNode = $this->createLink($xml, $route);
            $nodeItem->appendChild($linkNode);
        }
    }
private function writeItem(XMLManager $xml, ItemInterface $item)
    {
        $nodeItem = $this->createItem($xml);
        $xml->addTextNode('title', $item->getFeedTitle(), $nodeItem);

        $type = $this->itemHas($item, 'getAtomContentType') ? $item->getAtomContentType() : null;
        $content = $xml->addTextNode('content', $type === 'xhtml' ? $item->getFeedDescription() : htmlentities($item->getFeedDescription(), ENT_COMPAT, 'UTF-8'), $nodeItem);
        if(!empty($type)){
            $content->setAttribute('type', $type);
        }
        if($this->itemHas($item, 'getAtomContentLanguage')){
            $content->setAttribute('xml:lang', $item->getAtomContentLanguage());
        }


        $id=$item->getFeedId();
        if(empty($id))
        throw new \InvalidArgumentException('The method « getFeedId » CAN\'T return an empty value.');
        $xml->addTextNode('id', $id, $nodeItem);


        $xml->addTextNode('published', $item->getFeedDate()->format(\DateTime::ATOM), $nodeItem);

        $date = new \DateTime();
        $xml->addTextNode('updated', $item->getFeedDate()->format(\DateTime::ATOM), $nodeItem);

        if ($this->itemHas($item, 'getFeedAuthor')) {
            if ($author = $item->getFeedAuthor()) {
                $authorNode = $this->createAuthor($xml, $author);
                $nodeItem->appendChild($authorNode);
            }
        }
        if ($this->itemHas($item, 'getSummary')) {
            $type = $this->itemHas($item, 'getAtomSummaryType') ? $item->getAtomSummaryType() : null;
            $summary = $xml->addTextNode('category', $type === 'xhtml' ? $item->getFeedDescription() : htmlentities($item->getFeedSummary(), ENT_COMPAT, 'UTF-8'), $nodeItem);
            if(!empty($type)){
                $summary->setAttribute('type', $type);
            }
        }
        if ($this->itemHas($item, 'getAtomContributors')) {
            if ($contributors = $item->getAtomContributors($item)) {
                foreach($contributors as $contributor) {
                    $contribNode = $this->createContributor($xml, $contributor);
                    $nodeItem->appendChild($contribNode);
                }
            }
        }

        $routes = $item->getFeedRoutes();
        foreach($routes as $route) {
            $linkNode = $this->createLink($xml, $route);
            $nodeItem->appendChild($linkNode);
        }
    }
Write an ItemInterface into the feed

@param \Nekland\Bundle\FeedBundle\XML\XMLManager     $xml
@param \Nekland\Bundle\FeedBundle\Item\ItemInterface $item
@return void