Commit | Line | Data |
---|---|---|
285b1d92 MW |
1 | <?php |
2 | namespace wcf\system\comment\manager; | |
3 | use wcf\data\comment\response\CommentResponse; | |
4 | use wcf\data\comment\Comment; | |
5 | ||
6 | /** | |
7 | * Default interface for comment managers. | |
8 | * | |
9 | * @author Alexander Ebert | |
ca4ba303 | 10 | * @copyright 2001-2014 WoltLab GmbH |
285b1d92 | 11 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
f4f05aa5 | 12 | * @package com.woltlab.wcf |
285b1d92 MW |
13 | * @subpackage system.comment.manager |
14 | * @category Community Framework | |
15 | */ | |
16 | interface ICommentManager { | |
17 | /** | |
18 | * Returns true if the current user may add comments or responses. | |
19 | * | |
20 | * @param integer $objectID | |
21 | * @return boolean | |
22 | */ | |
23 | public function canAdd($objectID); | |
24 | ||
25 | /** | |
26 | * Returns true if the current user may edit given comment. | |
27 | * | |
0ad90fc3 | 28 | * @param \wcf\data\comment\Comment $comment |
285b1d92 MW |
29 | * @return boolean |
30 | */ | |
31 | public function canEditComment(Comment $comment); | |
32 | ||
33 | /** | |
34 | * Returns true if the current user may edit given response. | |
35 | * | |
0ad90fc3 | 36 | * @param \wcf\data\comment\response\CommentResponse $response |
285b1d92 MW |
37 | * @return boolean |
38 | */ | |
39 | public function canEditResponse(CommentResponse $response); | |
40 | ||
41 | /** | |
42 | * Returns true if the current user may delete given comment. | |
43 | * | |
0ad90fc3 | 44 | * @param \wcf\data\comment\Comment $comment |
285b1d92 MW |
45 | * @return boolean |
46 | */ | |
47 | public function canDeleteComment(Comment $comment); | |
48 | ||
49 | /** | |
50 | * Returns true if the current user may delete given response. | |
51 | * | |
0ad90fc3 | 52 | * @param \wcf\data\comment\response\CommentResponse $response |
285b1d92 MW |
53 | */ |
54 | public function canDeleteResponse(CommentResponse $response); | |
55 | ||
56 | /** | |
57 | * Returns true if the current user may moderated content identified by | |
58 | * object type id and object id. | |
59 | * | |
60 | * @param integer $objectTypeID | |
61 | * @param integer $objectID | |
62 | * @return boolean | |
63 | */ | |
64 | public function canModerate($objectTypeID, $objectID); | |
65 | ||
66 | /** | |
67 | * Returns the amount of comments per page. | |
68 | * | |
69 | * @return integer | |
70 | */ | |
71 | public function getCommentsPerPage(); | |
72 | ||
73 | /** | |
74 | * Returns a link to given object type id and object id. | |
75 | * | |
76 | * @param integer $objectTypeID | |
77 | * @param integer $objectID | |
78 | * @return string | |
79 | */ | |
80 | public function getLink($objectTypeID, $objectID); | |
81 | ||
82 | /** | |
83 | * Returns the title for a comment or response. | |
84 | * | |
85 | * @param integer $objectTypeID | |
86 | * @param integer $objectID | |
87 | * @param boolean $isResponse | |
88 | * @return string | |
89 | */ | |
90 | public function getTitle($objectTypeID, $objectID, $isResponse = false); | |
91 | ||
92 | /** | |
93 | * Returns true if comments and responses for given object id are accessible | |
94 | * by current user. | |
95 | * | |
96 | * @param integer $objectID | |
97 | * @param boolean $validateWritePermission | |
98 | * @return boolean | |
99 | */ | |
100 | public function isAccessible($objectID, $validateWritePermission = false); | |
101 | ||
102 | /** | |
103 | * Updates total count of comments (includes responses). | |
104 | * | |
105 | * @param integer $objectID | |
106 | * @param integer $value | |
107 | */ | |
108 | public function updateCounter($objectID, $value); | |
166d2b91 MW |
109 | |
110 | /** | |
1a6e8c52 | 111 | * Returns true if this comment type supports likes. |
166d2b91 MW |
112 | * |
113 | * @return boolean | |
114 | */ | |
115 | public function supportsLike(); | |
116 | ||
117 | /** | |
1a6e8c52 MS |
118 | * Returns true if this comment type supports reports. |
119 | * | |
166d2b91 MW |
120 | * @return boolean |
121 | */ | |
122 | public function supportsReport(); | |
285b1d92 | 123 | } |