コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function create(CommentInterface $comment)
 {
     $this->commentBlamer->blame($comment);
     if ($this->spamDetection->isSpam($comment)) {
         return false;
     }
     $this->commentManager->addComment($comment);
     return true;
 }
コード例 #2
0
 /**
  * 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());
 }
コード例 #3
0
 /**
  * {@inheritDoc}
  */
 public function getClass()
 {
     return $this->realManager->getClass();
 }