2fe95d851917bb75cc36e27081dc965f8a7d6009
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\moderation\queue\report;
3 use wcf\data\moderation\queue\ViewableModerationQueue;
4 use wcf\system\moderation\queue\AbstractCommentResponseModerationQueueHandler;
5
6 /**
7 * An implementation of IModerationQueueReportHandler for comment responses.
8 *
9 * @author Alexander Ebert
10 * @copyright 2001-2018 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package WoltLabSuite\Core\System\Moderation\Queue
13 */
14 class CommentResponseModerationQueueReportHandler extends AbstractCommentResponseModerationQueueHandler implements IModerationQueueReportHandler {
15 /**
16 * @inheritDoc
17 */
18 public function canReport($objectID) {
19 if (!$this->isValid($objectID)) {
20 return false;
21 }
22
23 $response = $this->getResponse($objectID);
24 $comment = $this->getComment($response->commentID);
25 if (!$this->getCommentManager($comment)->isAccessible($comment->objectID)) {
26 return false;
27 }
28
29 return true;
30 }
31
32 /**
33 * @inheritDoc
34 */
35 public function getReportedContent(ViewableModerationQueue $queue) {
36 return $this->getRelatedContent($queue);
37 }
38
39 /**
40 * @inheritDoc
41 */
42 public function getReportedObject($objectID) {
43 return $this->getResponse($objectID);
44 }
45 }