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