Mity Docs Mity Docs for Mity Digital
Feedamic Documentation

Interface

Feedamic includes a FeedEntry model class which should be adequate for most use cases.

However, since v2.4 you can also use your own model for your feeds.

Implementation

Your own model will need to implement the FeedamicEntry interface, and implement each of the methods.

1<?php
2 
3namespace App\Models;
4 
5class MyFeedEntry implements \MityDigital\Feedamic\Contracts\FeedamicEntry
6{
7 // ...
8}

Interface methods

__construct

Accepts an array of attributes, and has no return value.

This is where you can store the attributes within the model.

hasSummaryOrImage

Returns a boolean, either true or false, for whether the feed entry has a summary or image.

title

Returns the title, a string, of the entry.

Accepts an optional boolean parameter, and when set to true should encode the entities within the title, such as with htmlspecialchars.

summary

Returns the summary, a string, of the entry. This includes the image, if used.

Accepts an optional boolean parameter, and when set to true should encode the entities within the summary markup, such as with htmlspecialchars.