Interfaces

interface Brotkrueml\FeedGenerator\Feed\AuthorInterface

Has to be implemented to provide an author to a feed or an item. The extension provides already an implementation (Brotkrueml\FeedGenerator\Feed\Author) which can be used. However, if you have special needs you can use this interface to implement a custom author class.

getName()
Return type

string

Returns

The name of the author.

getUri()
Return type

string

Returns

The URI of the author. Return an empty string to omit the property.

getEmail()
Return type

string

Returns

The email address of the author. Return an empty string to omit the property.

interface Brotkrueml\FeedGenerator\Feed\FeedInterface

Has to be implemented to provide a feed. It extends Brotkrueml\FeedGenerator\Feed\NodeInterface.

getDescription()
Return type

string

Returns

The description of the feed. Return an empty string to omit the property in the feed.

getLanguage()
Return type

string

Returns

The language of the feed. Return an empty string to omit the property in the feed.

Return type

string

Returns

The logo of the feed. Return an empty string to omit the property in the feed.

getItems()
Return type

ItemInterface[]

Returns

The items of the feed. Return an empty array to omit the property in the feed.

interface Brotkrueml\FeedGenerator\Feed\FeedFormatAwareInterface

This interface is used in combination with the Brotkrueml\FeedGenerator\Feed\FeedInterface to set the current feed format into a feed implementation. It can be used in combination with the Brotkrueml\FeedGenerator\Feed\StyleSheetAwareInterface to provide different XSL stylesheets for Atom and RSS feeds.

setFormat($format)

In the implementation of this method store the format in a property of your class for later usage.

Parameters
interface Brotkrueml\FeedGenerator\Feed\ItemInterface

Has to be implemented to provide an item of the feed. It extends Brotkrueml\FeedGenerator\Feed\NodeInterface. The extension provides already an implementation (Brotkrueml\FeedGenerator\Feed\Item) which can be used. However, if you have special needs you can use this interface to implement a custom item class.

getSummary()
Return type

string

Returns

The summary of the feed. Return an empty string to omit the property in the feed.

getContent()
Return type

string

Returns

The content of the feed. Return an empty string to omit the property in the feed.

Note

When the item is used for an RSS feed, the summary is not displayed, the content is used for the description tag of an item.

interface Brotkrueml\FeedGenerator\Feed\MediaInterface

Has to be implemented to provide one or more media assets (like image, video, audio) to an item. The extension provides already an implementation (Brotkrueml\FeedGenerator\Feed\Media) which can be used. However, if you have special needs you can use this interface to implement a custom media class.

getType()
Return type

string

Returns

Get the mime type of the media.

getUrl()
Return type

string

Returns

Get the URL of the media.

getLength()
Return type

int

Returns

Get the length (in bytes) of the media.

getTitle()
Return type

string

Returns

Get the title of the media. It is used only in a JSON feed.

interface Brotkrueml\FeedGenerator\Feed\NodeInterface

This interface is extended by the Brotkrueml\FeedGenerator\Feed\FeedInterface and the Brotkrueml\FeedGenerator\Feed\ItemInterface.

getLastModified()
Return type

?DateTimeInterface

Returns

The date and time of the last modification. Return null to omit the property in the feed.

getTitle()
Return type

string

Returns

The title. Return an empty string to omit the property in the feed.

getPublicId()
Return type

string

Returns

The ID. Return an empty string to omit the property in the feed.

Return type

string

Returns

The link. Return an empty string to omit the property in the feed.

interface Brotkrueml\FeedGenerator\Feed\RequestAwareInterface

This interface is used in combination with the Brotkrueml\FeedGenerator\Feed\FeedInterface to inject the request into a feed implementation.

setRequest($request)

In the implementation of this method store the request object in a property of your class for later usage.

Parameters
  • $request (Psr\Http\Message\ServerRequestInterface) -- The request object.

interface Brotkrueml\FeedGenerator\Feed\StyleSheetAwareInterface

This interface is used in combination with the Brotkrueml\FeedGenerator\Feed\FeedInterface to get an XSL stylesheet which is applied to an Atom or RSS feed.

getStyleSheet()
Return type

string

Returns

The path to an XSL stylesheet. Return an empty string to omit the adding of the stylesheet to the XML feed.