Class to handle turning raw user alerts into renderable items

author kier

 Methods

Determines if the given alert is viewable.

canViewAlert(array $alert, mixed $content, array $viewingUser) : boolean

Parameters

$alert

array

$content

mixed

$viewingUser

array

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

Returns

boolean

Factory method to get the named alert handler.

create(string $class) : \XenForo_AlertHandler_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 alerts.

getContentByIds(array $contentIds, \XenForo_Model_Alert $model, integer $userId, array $viewingUser) : array

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

Parameters

$contentIds

array

$model

\XenForo_Model_Alert

Alert model invoking this

$userId

integer

User ID the alerts are for

$viewingUser

array

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

Returns

array

Prepares a news feed item for rendering.

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

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

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 'alert_{contentType}_{action}'

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

Parameters

$contentType

string

$action

string

Returns

string

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

_prepareAlertAfterAction(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 alerts, BEFORE content-type/action specific manipulation Designed to be overridden by child classes

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