public function spamCheck(CommentEvent $event)
 {
     $comment = $event->getComment();
     if (!$this->detector->isSpam($comment)) {
         return;
     }
     if (null !== $this->logger) {
         $this->logger->info('Comment is marked as spam from detector.');
     }
     $comment->setStatus(CommentInterface::STATUS_SPAM);
     $event->stopPropagation();
 }
Ejemplo n.º 2
0
 /**
  * Constructor.
  *
  * @param CommentInterface $comment
  * @param mixed            $previousStatus
  */
 public function __construct($comment, $previousStatus)
 {
     parent::__construct($comment);
     $this->previousStatus = $previousStatus;
 }