interface ForumManagerInterface (View source)

Provides forum manager interface.

Methods

array
getTopics(int $tid, AccountInterface $account)

Gets list of forum topics.

array
getChildren(int $vid, int $tid)

Utility method to fetch the child forums for a given forum.

getIndex()

Generates and returns the forum index.

resetCache()

Resets the ForumManager index and history.

bool
checkNodeType(NodeInterface $node)

Checks whether a node can be used in a forum, based on its content type.

The
unreadTopics(int $term, int $uid)

Calculates the number of new posts in a forum that the user has not yet read.

Details

array getTopics(int $tid, AccountInterface $account)

Gets list of forum topics.

Parameters

int $tid

Term ID.

AccountInterface $account

Account to fetch topics for.

Return Value

array

Array with keys 'topics' and 'header'.

array getChildren(int $vid, int $tid)

Utility method to fetch the child forums for a given forum.

Parameters

int $vid

The forum vocabulary ID.

int $tid

The forum ID to fetch the children for.

Return Value

array

Array of children.

TermInterface getIndex()

Generates and returns the forum index.

The forum index is a pseudo term that provides an overview of all forums.

Return Value

TermInterface

A pseudo term representing the overview of all forums.

resetCache()

Resets the ForumManager index and history.

bool checkNodeType(NodeInterface $node)

Checks whether a node can be used in a forum, based on its content type.

Parameters

NodeInterface $node

A node entity.

Return Value

bool

Boolean indicating if the node can be assigned to a forum.

The unreadTopics(int $term, int $uid)

Calculates the number of new posts in a forum that the user has not yet read.

Nodes are new if they are newer than HISTORY_READ_LIMIT.

Parameters

int $term

The term ID of the forum.

int $uid

The user ID.

Return Value

The

number of new posts in the forum that have not been read by the user.