Property | Type | Description | |
---|---|---|---|
$dom | XML DOMDocument | ||
$domain | string | null | ||
$feed | A feed instance | ||
$itemFields | Contain item Field instances for this formatter | ||
$translator | Symfony\Component\Translation\TranslatorInterface |
Method | Description | |
---|---|---|
__construct ( Symfony\Component\Translation\TranslatorInterface $translator, string | null $domain = null ) | Construct a formatter with given feed. | |
initialize ( ) | Initializes feed. | |
render ( ) : string | This method render the given feed transforming the DOMDocument to XML. |
Method | Description | |
---|---|---|
addAttributes ( DOMElement $element, Eko\FeedBundle\Field\Item\ItemFieldInterface $field, Eko\FeedBundle\Item\Writer\ItemInterface $item = null ) | Add field attributes to a DOM element. | |
addChannelFields ( DOMElement $channel ) | Adds channel fields to given channel. | |
format ( Eko\FeedBundle\Field\Item\ItemFieldInterface $field, Eko\FeedBundle\Item\Writer\ItemInterface $item ) : string | Format items field. | |
formatGroupItemField ( Eko\FeedBundle\Field\Item\GroupItemField $field, Eko\FeedBundle\Item\Writer\ItemInterface $item ) : DOMElement | Format a group item field. | |
formatItemField ( Eko\FeedBundle\Field\Item\ItemFieldInterface $field, Eko\FeedBundle\Item\Writer\ItemInterface $item ) : array | DOMElement | Format an item field. | |
formatMediaItemField ( Eko\FeedBundle\Field\Item\MediaItemField $field, Eko\FeedBundle\Item\Writer\ItemInterface $item ) : array | null | DOMElement | Format a media item field. | |
formatWithOptions ( Eko\FeedBundle\Field\Item\ItemFieldInterface $field, Eko\FeedBundle\Item\Writer\ItemInterface $item, string $value ) : DOMElement | Format an item field. | |
translate ( string $value ) : string | Translates a value. |
public __construct ( Symfony\Component\Translation\TranslatorInterface $translator, string | null $domain = null ) | ||
$translator | Symfony\Component\Translation\TranslatorInterface | A Symfony translator service instance |
$domain | string | null | A Symfony translation domain |
protected addAttributes ( DOMElement $element, Eko\FeedBundle\Field\Item\ItemFieldInterface $field, Eko\FeedBundle\Item\Writer\ItemInterface $item = null ) | ||
$element | DOMElement | A XML DOM element |
$field | Eko\FeedBundle\Field\Item\ItemFieldInterface | A feed field instance |
$item | Eko\FeedBundle\Item\Writer\ItemInterface | A feed item instance |
protected addChannelFields ( DOMElement $channel ) | ||
$channel | DOMElement |
protected formatGroupItemField ( Eko\FeedBundle\Field\Item\GroupItemField $field, Eko\FeedBundle\Item\Writer\ItemInterface $item ) : DOMElement | ||
$field | Eko\FeedBundle\Field\Item\GroupItemField | An item field instance |
$item | Eko\FeedBundle\Item\Writer\ItemInterface | An entity instance |
return | DOMElement |
protected formatItemField ( Eko\FeedBundle\Field\Item\ItemFieldInterface $field, Eko\FeedBundle\Item\Writer\ItemInterface $item ) : array | DOMElement | ||
$field | Eko\FeedBundle\Field\Item\ItemFieldInterface | An item field instance |
$item | Eko\FeedBundle\Item\Writer\ItemInterface | An entity instance |
return | array | DOMElement |
protected formatMediaItemField ( Eko\FeedBundle\Field\Item\MediaItemField $field, Eko\FeedBundle\Item\Writer\ItemInterface $item ) : array | null | DOMElement | ||
$field | Eko\FeedBundle\Field\Item\MediaItemField | A media item field instance |
$item | Eko\FeedBundle\Item\Writer\ItemInterface | An entity instance |
return | array | null | DOMElement |
protected formatWithOptions ( Eko\FeedBundle\Field\Item\ItemFieldInterface $field, Eko\FeedBundle\Item\Writer\ItemInterface $item, string $value ) : DOMElement | ||
$field | Eko\FeedBundle\Field\Item\ItemFieldInterface | An item field instance |
$item | Eko\FeedBundle\Item\Writer\ItemInterface | An entity instance |
$value | string | A field value |
return | DOMElement |
protected $itemFields |