/** * {@inheritDoc} */ public function create(CommentInterface $comment) { $this->commentBlamer->blame($comment); if ($this->spamDetection->isSpam($comment)) { return false; } $this->commentManager->addComment($comment); return true; }
/** * Increase the thread comments number * * @param \FOS\CommentBundle\Event\CommentEvent $event */ public function onCommentPersist(CommentEvent $event) { $comment = $event->getComment(); if (!$this->commentManager->isNewComment($comment)) { return; } $thread = $comment->getThread(); $thread->incrementNumComments(1); $thread->setLastCommentAt($comment->getCreatedAt()); }
/** * {@inheritDoc} */ public function getClass() { return $this->realManager->getClass(); }