PHP Class DiscussionController, vanilla

Author: azazello
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Méthodes publiques

Свойство Type Description
$CategoryID Unique identifier.
$CommentModel CommentModel
$DiscussionModel DiscussionModel
$Uses Models to include.

Méthodes publiques

Méthode Description
__get ( $Name ) : mixed
announce ( integer $DiscussionID = '', $Target = '' ) Allows user to announce or unannounce a discussion.
bookmark ( integer $DiscussionID = null ) Allows user to bookmark or unbookmark a discussion.
close ( integer $DiscussionID = '', boolean $Close = true, $From = 'list' ) Allows user to close or re-open a discussion.
comment ( integer $CommentID ) Display discussion page starting with a particular comment.
delete ( integer $DiscussionID, $Target = '' ) Allows user to delete a discussion.
deleteComment ( integer $CommentID = '', string $TransientKey = '' ) Allows user to delete a comment.
dismissAnnouncement ( integer $DiscussionID = '' ) Allows user to remove announcement.
embed ( integer $DiscussionID = '', string $DiscussionStub = '', integer $Offset = '', integer $Limit = '' ) Alternate version of Index that uses the embed master view.
getNew ( integer $DiscussionID, integer $LastCommentID ) Display comments in a discussion since a particular CommentID.
index ( integer $DiscussionID = '', string $DiscussionStub = '', integer $Page = '' ) Default single discussion display.
initialize ( ) Highlight route & add common JS definitions.
refetchPageInfo ( type $DiscussionID ) Re-fetch a discussion's content based on its foreign url.
sendOptions ( $discussion )
sink ( integer $DiscussionID = '', boolean $Sink = true, $From = 'list' ) Allows user to sink or unsink a discussion.

Méthodes protégées

Méthode Description
_setOpenGraph ( )
redirectDiscussion ( array | object $Discussion ) Redirect to the url specified by the discussion.

Method Details

__get() public méthode

public __get ( $Name ) : mixed
$Name
Résultat mixed

_setOpenGraph() protected méthode

protected _setOpenGraph ( )

announce() public méthode

If the discussion isn't announced, this announces it. If it is already announced, this unannounces it. Announced discussions stay at the top of the discussions list regardless of how long ago the last comment was.
Since: 2.0.0
public announce ( integer $DiscussionID = '', $Target = '' )
$DiscussionID integer Unique discussion ID.

bookmark() public méthode

If the discussion isn't bookmarked by the user, this bookmarks it. If it is already bookmarked, this unbookmarks it.
Since: 2.0.0
public bookmark ( integer $DiscussionID = null )
$DiscussionID integer Unique discussion ID.

close() public méthode

If the discussion isn't closed, this closes it. If it is already closed, this re-opens it. Closed discussions may not have new comments added to them.
Since: 2.0.0
public close ( integer $DiscussionID = '', boolean $Close = true, $From = 'list' )
$DiscussionID integer Unique discussion ID.
$Close boolean Whether or not to close the discussion.

comment() public méthode

Display discussion page starting with a particular comment.
Since: 2.0.0
public comment ( integer $CommentID )
$CommentID integer Unique comment ID

delete() public méthode

This is a "hard" delete - it is removed from the database.
Since: 2.0.0
public delete ( integer $DiscussionID, $Target = '' )
$DiscussionID integer Unique discussion ID.

deleteComment() public méthode

If the comment is the only one in the discussion, the discussion will be deleted as well. Users without administrative delete abilities should not be able to delete a comment unless it is a draft. This is a "hard" delete - it is removed from the database.
Since: 2.0.0
public deleteComment ( integer $CommentID = '', string $TransientKey = '' )
$CommentID integer Unique comment ID.
$TransientKey string Single-use hash to prove intent.

dismissAnnouncement() public méthode

Users may remove announcements from being displayed for themselves only. Does not affect what announcements are shown for other users.
Since: 2.0.0
public dismissAnnouncement ( integer $DiscussionID = '' )
$DiscussionID integer Unique discussion ID.

embed() public méthode

Alternate version of Index that uses the embed master view.
public embed ( integer $DiscussionID = '', string $DiscussionStub = '', integer $Offset = '', integer $Limit = '' )
$DiscussionID integer Unique identifier, if discussion has been created.
$DiscussionStub string Deprecated.
$Offset integer
$Limit integer

getNew() public méthode

Display comments in a discussion since a particular CommentID.
Since: 2.0.0
public getNew ( integer $DiscussionID, integer $LastCommentID )
$DiscussionID integer Unique discussion ID
$LastCommentID integer Only shows comments posted after this one

index() public méthode

Default single discussion display.
Since: 2.0.0
public index ( integer $DiscussionID = '', string $DiscussionStub = '', integer $Page = '' )
$DiscussionID integer Unique discussion ID
$DiscussionStub string URL-safe title slug
$Page integer The current page of comments

initialize() public méthode

Always called by dispatcher before controller's requested method.
Since: 2.0.0
public initialize ( )

redirectDiscussion() protected méthode

Redirect to the url specified by the discussion.
protected redirectDiscussion ( array | object $Discussion )
$Discussion array | object

refetchPageInfo() public méthode

Re-fetch a discussion's content based on its foreign url.
public refetchPageInfo ( type $DiscussionID )
$DiscussionID type

sendOptions() public méthode

public sendOptions ( $discussion )
$discussion

sink() public méthode

If the discussion isn't sunk, this sinks it. If it is already sunk, this unsinks it. Sunk discussions do not move to the top of the discussion list when a new comment is added.
Since: 2.0.0
public sink ( integer $DiscussionID = '', boolean $Sink = true, $From = 'list' )
$DiscussionID integer Unique discussion ID.
$Sink boolean Whether or not to unsink the discussion.

Property Details

$CategoryID public_oe property

Unique identifier.
public $CategoryID

$CommentModel public_oe property

public CommentModel $CommentModel
Résultat CommentModel

$DiscussionModel public_oe property

public DiscussionModel $DiscussionModel
Résultat DiscussionModel

$Uses public_oe property

Models to include.
public $Uses