/** * 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 isNewComment(CommentInterface $comment) { return $this->realManager->isNewComment($comment); }