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