b7efaf4f8c55558c9cc29873c35e0607a417d110
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\moderation\queue\activation;
3 use wcf\data\comment\CommentAction;
4 use wcf\data\moderation\queue\ModerationQueue;
5 use wcf\data\moderation\queue\ViewableModerationQueue;
6 use wcf\system\moderation\queue\AbstractCommentResponseModerationQueueHandler;
7
8 /**
9 * An implementation of IModerationQueueReportHandler for comment responses.
10 *
11 * @author Alexander Ebert
12 * @copyright 2001-2018 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\Moderation\Queue
15 */
16 class CommentResponseModerationQueueActivationHandler extends AbstractCommentResponseModerationQueueHandler implements IModerationQueueActivationHandler {
17 /**
18 * @inheritDoc
19 */
20 public function enableContent(ModerationQueue $queue) {
21 if ($this->isValid($queue->objectID) && $this->getResponse($queue->objectID)->isDisabled) {
22 $response = $this->getResponse($queue->objectID);
23
24 $commentAction = new CommentAction([$this->getComment($response->commentID)], 'enableResponse', [
25 'responses' => [$response]
26 ]);
27 $commentAction->executeAction();
28 }
29 }
30
31 /**
32 * @inheritDoc
33 */
34 public function getDisabledContent(ViewableModerationQueue $queue) {
35 return $this->getRelatedContent($queue);
36 }
37 }