/**
* Construct a formatter with given feed
*
* @param Feed $feed A feed instance
*/
public function __construct(Feed $feed)
{
$this->fields = array(new Field('id', 'getFeedItemLink', array('cdata' => false)), new Field('title', 'getFeedItemTitle', array('cdata' => true)), new Field('summary', 'getFeedItemDescription', array('cdata' => true)), new Field('link', 'getFeedItemLink', array('attribute' => true, 'attribute_name' => 'href')), new Field('updated', 'getFeedItemPubDate', array('date_format' => \DateTime::ATOM)));
$author = $feed->get('author');
if (empty($author)) {
throw new \InvalidArgumentException('Atom formatter requires an "author" parameter in configuration.');
}
parent::__construct($feed);
$this->initialize();
}