Loader/AtomLoader.php
protected function addItem(\SimpleXMLElement $element, Feed $feed)
    {
        $item = new GenericItem;
        foreach ($element as $subElement) {
            $method = isset(self::$methodMapping[$subElement->getName()]) ?
                    self::$methodMapping[$subElement->getName()] :
                    'setFeed' . ucfirst($subElement->getName());
            $data = '';


            if ($subElement->getName() == 'link') {

                if(($routes = $item->getFeedRoutes()) == null)
                    $routes = array();

                $i = count($routes);

                foreach($subElement->attributes() as $attrName => $attrValue) {
                    if($attrName == 'href') {
                        $routes[$i]['url'] = $attrValue;
                    } else {
                        $routes[$i][$attrName] = $attrValue;
                    }
                }
                $data = $routes;

            } elseif ($subElement->getName() == 'published') {
                $data = \DateTime::createFromFormat(\DateTime::ATOM, (string) $subElement);

            } elseif (count($subElement) === 0 && $subElement->getName() != 'updated') {

                if($subElement->getName() == 'content' || $subElement->getName() == 'title' || $subElement->getName() == 'summary') {
                    $typemethod = 'setAtom' . $subElement->getName() . 'Type';

                    $attributes = $subElement->attributes();
                    if(isset($attributes['type']))
                        $item->$typemethod($attributes['type']);
                    if(isset($attributes['xml:lang']) && $subElement->getName() == 'content') {
                        $item->setAtomContentLanguage($attributes['xml:lang']);
                    }
                }
                $data = (string) $subElement;

            } else {
                $data = $this->extractParam($subElement);
            }
            $reflection = new \ReflectionClass(get_class($item));
            if($reflection->hasMethod($method))
                $item->$method($data);
        }

        $feed->add($item);
    }
protected function addItem(\SimpleXMLElement $element, Feed $feed)
    {
        $item = new GenericItem;
        foreach ($element as $subElement) {
            $method = isset(self::$methodMapping[$subElement->getName()]) ?
                    self::$methodMapping[$subElement->getName()] :
                    'setFeed' . ucfirst($subElement->getName());
            $data = '';


            if ($subElement->getName() == 'link') {

                if(($routes = $item->getFeedRoutes()) == null)
                    $routes = array();

                $i = count($routes);

                foreach($subElement->attributes() as $attrName => $attrValue) {
                    if($attrName == 'href') {
                        $routes[$i]['url'] = $attrValue;
                    } else {
                        $routes[$i][$attrName] = $attrValue;
                    }
                }
                $data = $routes;

            } elseif ($subElement->getName() == 'published') {
                $data = \DateTime::createFromFormat(\DateTime::ATOM, (string) $subElement);

            } elseif (count($subElement) === 0 && $subElement->getName() != 'updated') {

                if($subElement->getName() == 'content' || $subElement->getName() == 'title' || $subElement->getName() == 'summary') {
                    $typemethod = 'setAtom' . $subElement->getName() . 'Type';

                    $attributes = $subElement->attributes();
                    if(isset($attributes['type']))
                        $item->$typemethod($attributes['type']);
                    if(isset($attributes['xml:lang']) && $subElement->getName() == 'content') {
                        $item->setAtomContentLanguage($attributes['xml:lang']);
                    }
                }
                $data = (string) $subElement;

            } else {
                $data = $this->extractParam($subElement);
            }
            $reflection = new \ReflectionClass(get_class($item));
            if($reflection->hasMethod($method))
                $item->$method($data);
        }

        $feed->add($item);
    }
Adds an Item to the feed

@param \SimpleXMLElement        $element
@param \Nekland\Bundle\FeedBundle\Feed $feed
@return void