c2b1c3cc03ef8e9113301434f7fdd18373f1b833
[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\AbstractCommentCommentModerationQueueHandler;
5
6 /**
7 * An implementation of IModerationQueueReportHandler for comments.
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 CommentCommentModerationQueueReportHandler extends AbstractCommentCommentModerationQueueHandler implements IModerationQueueReportHandler {
15 /**
16 * @inheritDoc
17 */
18 protected $definitionName = 'com.woltlab.wcf.moderation.report';
19
20 /**
21 * @inheritDoc
22 */
23 public function canReport($objectID) {
24 if (!$this->isValid($objectID)) {
25 return false;
26 }
27
28 $comment = $this->getComment($objectID);
29 if (!$this->getCommentManager($comment)->isAccessible($comment->objectID)) {
30 return false;
31 }
32
33 return true;
34 }
35
36 /**
37 * @inheritDoc
38 */
39 public function getReportedContent(ViewableModerationQueue $queue) {
40 return $this->getRelatedContent($queue);
41 }
42
43 /**
44 * @inheritDoc
45 */
46 public function getReportedObject($objectID) {
47 return $this->getComment($objectID);
48 }
49 }