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