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
71 * @deprecated 6.1 use `ICommentPermissionManager::canModerateObject()` instead
73 public function canModerate($objectTypeID, $objectID);
76 * Returns the amount of comments per page.
80 public function getCommentsPerPage();
83 * Returns a link to the commented object with the given object type id and object id.
85 * @param int $objectTypeID
86 * @param int $objectID
89 public function getLink($objectTypeID, $objectID);
92 * Returns the link to the given comment.
94 * @param Comment $comment
97 public function getCommentLink(Comment
$comment);
100 * Returns the link to the given comment response.
102 * @param CommentResponse $response
105 public function getResponseLink(CommentResponse
$response);
108 * Returns the title for a comment or response.
110 * @param int $objectTypeID
111 * @param int $objectID
112 * @param bool $isResponse
115 public function getTitle($objectTypeID, $objectID, $isResponse = false);
118 * Returns true if comments and responses for given object id are accessible
121 * @param int $objectID
122 * @param bool $validateWritePermission
125 public function isAccessible($objectID, $validateWritePermission = false);
128 * Updates total count of comments (includes responses).
130 * @param int $objectID
133 public function updateCounter($objectID, $value);
136 * Returns true if this comment type supports likes.
140 public function supportsLike();
143 * Returns true if this comment type supports reports.
147 public function supportsReport();
150 * Sets the list of disallowed bbcodes.
152 public function setDisallowedBBCodes();
155 * Returns whether the given Comment or CommentResponse was created by
156 * the content's author.
158 * @param Comment|CommentResponse $commentOrResponse
161 public function isContentAuthor($commentOrResponse);