3 namespace wcf\system\comment\manager
;
5 use wcf\data\comment\Comment
;
6 use wcf\data\comment\response\CommentResponse
;
9 * Default interface for comment managers.
11 * @author Alexander Ebert
12 * @copyright 2001-2019 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 interface ICommentManager
18 * Returns true if the current user may add comments or responses.
20 * @param int $objectID
23 public function canAdd($objectID);
26 * Returns true if a comment requires approval.
28 * @param int $objectID
31 public function canAddWithoutApproval($objectID);
34 * Returns true if the current user may edit given comment.
36 * @param Comment $comment
39 public function canEditComment(Comment
$comment);
42 * Returns true if the current user may edit given response.
44 * @param CommentResponse $response
47 public function canEditResponse(CommentResponse
$response);
50 * Returns true if the current user may delete given comment.
52 * @param Comment $comment
55 public function canDeleteComment(Comment
$comment);
58 * Returns true if the current user may delete given response.
60 * @param CommentResponse $response
62 public function canDeleteResponse(CommentResponse
$response);
65 * Returns true if the current user may moderated content identified by
66 * object type id and object id.
68 * @param int $objectTypeID
69 * @param int $objectID
72 public function canModerate($objectTypeID, $objectID);
75 * Returns the amount of comments per page.
79 public function getCommentsPerPage();
82 * Returns a link to the commented object with the given object type id and object id.
84 * @param int $objectTypeID
85 * @param int $objectID
88 public function getLink($objectTypeID, $objectID);
91 * Returns the link to the given comment.
93 * @param Comment $comment
96 public function getCommentLink(Comment
$comment);
99 * Returns the link to the given comment response.
101 * @param CommentResponse $response
104 public function getResponseLink(CommentResponse
$response);
107 * Returns the title for a comment or response.
109 * @param int $objectTypeID
110 * @param int $objectID
111 * @param bool $isResponse
114 public function getTitle($objectTypeID, $objectID, $isResponse = false);
117 * Returns true if comments and responses for given object id are accessible
120 * @param int $objectID
121 * @param bool $validateWritePermission
124 public function isAccessible($objectID, $validateWritePermission = false);
127 * Updates total count of comments (includes responses).
129 * @param int $objectID
132 public function updateCounter($objectID, $value);
135 * Returns true if this comment type supports likes.
139 public function supportsLike();
142 * Returns true if this comment type supports reports.
146 public function supportsReport();
149 * Sets the list of disallowed bbcodes.
151 public function setDisallowedBBCodes();
154 * Returns whether the given Comment or CommentResponse was created by
155 * the content's author.
157 * @param Comment|CommentResponse $commentOrResponse
160 public function isContentAuthor($commentOrResponse);