Class to handle turning raw post news feed events into renderable output

package XenForo_NewsFeed
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
InheritedStatic

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

inherited_from \XenForo_NewsFeedHandler_Abstract::create()
inherited_from \XenForo_NewsFeedHandler_DiscussionMessage::create()

Parameters

$class

string

Class to load

Returns

Fetches related content (profile posts) by IDs

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
Inherited

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

inherited_from \XenForo_NewsFeedHandler_Abstract::prepareNewsFeedItem()
inherited_from \XenForo_NewsFeedHandler_DiscussionMessage::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
Inherited
inherited_from \XenForo_NewsFeedHandler_Abstract::renderHtml()
inherited_from \XenForo_NewsFeedHandler_DiscussionMessage::renderHtml()

Parameters

$item

array

Returns

Returns the primary key names for user profile posts

_getContentPrimaryKeynames() : array

Returns

arrayprofile_post_id

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

_getDefaultTemplateTitle(string $contentType, string $action) : string
Inherited
inherited_from \XenForo_NewsFeedHandler_Abstract::_getDefaultTemplateTitle()
inherited_from \XenForo_NewsFeedHandler_DiscussionMessage::_getDefaultTemplateTitle()

Parameters

$contentType

string

$action

string

Returns

string

_getProfilePostModel()

_getProfilePostModel() : \XenForo_Model_ProfilePost

Creates a 'userReceiver' key containing 'user_id' and 'username' in the item array

_prepareInsert(array $item) : array

Parameters

$item

array

Returns

array$item

Prepares the news feed item for display

_prepareNewsFeedItemAfterAction(array $item, array $content, array $viewingUser) : array
Inherited
inherited_from \XenForo_NewsFeedHandler_DiscussionMessage::_prepareNewsFeedItemAfterAction()

Parameters

$item

array

News feed item

$content

array

News feed 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
Inherited
inherited_from \XenForo_NewsFeedHandler_Abstract::_prepareNewsFeedItemBeforeAction()
inherited_from \XenForo_NewsFeedHandler_DiscussionMessage::_prepareNewsFeedItemBeforeAction()

Parameters

$item

$content

$viewingUser

array

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

Returns

array

 Properties

 

$_profilePostModel