PHP Класс DiscussionController, vanilla

Автор: azazello
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$CategoryID Unique identifier.
$CommentModel CommentModel
$DiscussionModel DiscussionModel
$Uses Models to include.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_setOpenGraph ( )
redirectDiscussion ( array | object $Discussion ) Redirect to the url specified by the discussion.

Описание методов

__get() публичный Метод

public __get ( $Name ) : mixed
$Name
Результат mixed

_setOpenGraph() защищенный Метод

protected _setOpenGraph ( )

announce() публичный Метод

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.
С версии: 2.0.0
public announce ( integer $DiscussionID = '', $Target = '' )
$DiscussionID integer Unique discussion ID.

bookmark() публичный Метод

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

close() публичный Метод

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.
С версии: 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() публичный Метод

Display discussion page starting with a particular comment.
С версии: 2.0.0
public comment ( integer $CommentID )
$CommentID integer Unique comment ID

delete() публичный Метод

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

deleteComment() публичный Метод

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.
С версии: 2.0.0
public deleteComment ( integer $CommentID = '', string $TransientKey = '' )
$CommentID integer Unique comment ID.
$TransientKey string Single-use hash to prove intent.

dismissAnnouncement() публичный Метод

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

embed() публичный Метод

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() публичный Метод

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

index() публичный Метод

Default single discussion display.
С версии: 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() публичный Метод

Always called by dispatcher before controller's requested method.
С версии: 2.0.0
public initialize ( )

redirectDiscussion() защищенный Метод

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

refetchPageInfo() публичный Метод

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

sendOptions() публичный Метод

public sendOptions ( $discussion )
$discussion

sink() публичный Метод

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.
С версии: 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.

Описание свойств

$CategoryID публичное свойство

Unique identifier.
public $CategoryID

$CommentModel публичное свойство

public CommentModel $CommentModel
Результат CommentModel

$DiscussionModel публичное свойство

public DiscussionModel $DiscussionModel
Результат DiscussionModel

$Uses публичное свойство

Models to include.
public $Uses