Class to handle turning raw news feed events into renderable items

author kier

 Methods

Determines if the given news feed item is viewable.

canViewNewsFeedItem(array $item, mixed $content, array $viewingUser) : boolean

Parameters

$item

array

$content

mixed

$viewingUser

array

Returns

boolean

Factory method to get the named news feed handler.

create(string $class) : \XenForo_NewsFeedHandler_Abstract

The class must exist and be autoloadable or an exception will be thrown.

Parameters

$class

string

Class to load

Returns

Fetches the content required by news feed items.

getContentByIds(array $contentIds, \XenForo_Model_NewsFeed $model, array $viewingUser) : array

Designed to be overridden by child classes using $model->getContentByIds($contentIds) or similar

Parameters

$contentIds

array

$viewingUser

array

Information about the viewing user (keys: user_id, permission_combination_id, permissions)

Returns

array

Prepares a news feed item for rendering.

prepareNewsFeedItem(array $item, array $viewingUser) : array

Designed to be overriden by extended classes, while retaining the call to _prepareNewsFeedItem.

Parameters

$item

$viewingUser

array

Information about the viewing user (keys: user_id, permission_combination_id, permissions)

Returns

array

Renders an item content template

renderHtml(array $item, \XenForo_View $view) : \XenForo_Template_Public

Parameters

$item

array

Returns

Returns a template title in the form 'news_feed_item_{contentType}_{action}'

_getDefaultTemplateTitle(string $contentType, string $action) : string

Parameters

$contentType

string

$action

string

Returns

string

Performs basic and generic preparation for news feed items, AFTER content-type/action specific manipulation Designed to be overridden by child classes

_prepareNewsFeedItemAfterAction(array $item, $content, array $viewingUser) : array

Parameters

$item

$content

$viewingUser

array

Information about the viewing user (keys: user_id, permission_combination_id, permissions)

Returns

array

Performs basic and generic preparation for news feed items, BEFORE content-type/action specific manipulation Designed to be overridden by child classes

_prepareNewsFeedItemBeforeAction(array $item, $content, array $viewingUser) : array

Parameters

$item

$content

$viewingUser

array

Information about the viewing user (keys: user_id, permission_combination_id, permissions)

Returns

array