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