\ForumThread
A representation of a forum thread. A forum thread is 1 topic on the forum which has multiple posts underneath it.
Synopsis
class ForumThread
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $defaults = ;
- private static array $indexes = ;
- private static null|boolean $_cache_displaysignatures = NULL;
- // methods
- public void canPost()
- public void canModerate()
- public void canView()
- public void canEdit()
- public void canDelete()
- public void canCreate()
- public bool getDisplaySignatures()
- public Post getLatestPost()
- public Post getFirstPost()
- public int getNumPosts()
- public void incNumViews()
- public String Link()
- public bool getHasSubscribed()
- public void onBeforeDelete()
- public void onAfterWrite()
- public Text getEscapedTitle()
Hierarchy
Extends
- DataObject
Members
private
- $_cache_displaysignatures — null|boolean
- $db
- $defaults
- $has_many
- $has_one
- $indexes
Methods
public
- Link() — Link to this forum thread
- canCreate() — Hook up into canPost check
- canDelete() — Hook up into moderation - users cannot delete their own posts/threads because we will loose history this way.
- canEdit() — Hook up into moderation.
- canModerate() — Check if user can moderate this thread
- canPost() — Check if the user can create new threads and add responses
- canView() — Check if user can view the thread
- getDisplaySignatures() — Are Forum Signatures on Member profiles allowed.
- getEscapedTitle()
- getFirstPost() — Return the first post from the thread. Useful to working out the original author
- getHasSubscribed() — Check to see if the user has subscribed to this thread
- getLatestPost() — Get the latest post from this thread. Nicer way then using an control from the template
- getNumPosts() — Return the number of posts in this thread. We could use count on the dataobject set but that is slower and causes a performance overhead
- incNumViews() — Check if they have visited this thread before. If they haven't increment the NumViews value by 1 and set visited to true.
- onAfterWrite()
- onBeforeDelete() — Before deleting the thread remove all the posts