1885cdbdd508c593f6460b258426dfcf5c7d808c
[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\AbstractCommentCommentModerationQueueHandler;
8
9 /**
10 * An implementation of IModerationQueueActivationHandler for comments.
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 CommentCommentModerationQueueActivationHandler extends AbstractCommentCommentModerationQueueHandler implements IModerationQueueActivationHandler {
18 /**
19 * @inheritDoc
20 */
21 protected $definitionName = 'com.woltlab.wcf.moderation.activation';
22
23 /**
24 * @inheritDoc
25 */
26 public function enableContent(ModerationQueue $queue) {
27 if ($this->isValid($queue->objectID) && $this->getComment($queue->objectID)->isDisabled) {
28 $commentAction = new CommentAction([$this->getComment($queue->objectID)], 'enable');
29 $commentAction->executeAction();
30 }
31 }
32
33 /**
34 * @inheritDoc
35 */
36 public function getDisabledContent(ViewableModerationQueue $queue) {
37 return $this->getRelatedContent($queue);
38 }
39 }