News feed handler for user profile changes

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()

Parameters

$class

string

Class to load

Returns

Just returns a value for each requested ID but does no actual DB work

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()

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()

Parameters

$item

array

Returns

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()

Parameters

$contentType

string

$action

string

Returns

string

_prepareHomepage()

_prepareHomepage(array $item) 

Parameters

$item

_prepareLocation()

_prepareLocation(array $item) 

Parameters

$item

Prepares the news feed item for display

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

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()

Parameters

$item

$content

$viewingUser

array

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

Returns

array

_prepareOccupation()

_prepareOccupation(array $item) 

Parameters

$item

_prepareStatus()

_prepareStatus(array $item) 

Parameters

$item

Sets a key with the same name as the item's 'action' and unserializes the 'extra_data' field into it, before deleting 'extra_data'

_setFieldFromExtraData(array $item) : \$item

Parameters

$item

array

Returns

\$item