Helper for forum, thread, and post related pages.

Provides validation methods, amongst other things.

package XenForo_Thread

 Methods

Constructor.

__construct(\XenForo_Controller $controller) 
Inherited

Sets up controller.

inherited_from \XenForo_ControllerHelper_Abstract::__construct()

Parameters

$controller

\XenForo_Controller

Checks that a forum is valid and viewable, before returning the forum's info.

assertForumValidAndViewable(integer | string $forumIdOrName, array $fetchOptions) : array

Parameters

$forumIdOrName

integerstring

ID or node name of forum

$fetchOptions

array

Extra data to fetch wtih the forum

Returns

arrayForum info

Checks that a thread is valid and viewable, before returning the post, thread, and containing forum's info.

assertPostValidAndViewable(integer $postId, array $postFetchOptions, array $threadFetchOptions, array $forumFetchOptions) : array

Parameters

$postId

integer

$postFetchOptions

array

Extra data to fetch with the post

$threadFetchOptions

array

Extra data to fetch with the thread

$forumFetchOptions

array

Extra data to fetch wtih the forum

Returns

arrayFormat: [0] => post info, [1] => thread info, [2] => forum info

Checks that a thread is valid and viewable, before returning the thread and containing forum's info.

assertThreadValidAndViewable(integer $threadId, array $threadFetchOptions, array $forumFetchOptions) : array

Parameters

$threadId

integer

$threadFetchOptions

array

Extra data to fetch with the thread

$forumFetchOptions

array

Extra data to fetch wtih the forum

Returns

arrayFormat: [0] => thread info, [1] => forum info

Gets the specified forum or throws an error.

getForumOrError(integer | string $forumIdOrName, array $fetchOptions) : array

Parameters

$forumIdOrName

integerstring

Forum ID or node name

$fetchOptions

array

Options that control the data fetched with the forum

Returns

array

Gets the breadcrumbs that relate to the specified node, including the supplied node.

getNodeBreadCrumbs(array $forum, boolean $includeSelf) : \unknown_type

Parameters

$forum

array

Information about the node

$includeSelf

boolean

Whether to include this node in the bread crumbs

Returns

\unknown_type

Gets the specified post or throws an error.

getPostOrError(integer $postId, array $fetchOptions) : array

Parameters

$postId

integer

$fetchOptions

array

Options that control the data fetched with the post

Returns

array

Gets the specified thread or throws an error.

getThreadOrError(integer $threadId, array $fetchOptions) : array

Parameters

$threadId

integer

$fetchOptions

array

Options that control the data fetched with the thread

Returns

array

Additional constructor setup behavior.

_constructSetup() 

 Properties

 

Calling controller.

$_controller : \XenForo_Controller
Inherited

inherited_from \XenForo_ControllerHelper_Abstract::$$_controller
 

The current browsing user.

$_visitor : \XenForo_Visitor