public function publishComment(Blog $blog, Comment $existingComment)
    {
        $existingComment->publish();
        if (BlogOptions::COMMENT_MODERATION_PRIOR_ONCE === $blog->getOptions()->getCommentModerationMode()
            && null !== $existingComment->getAuthor()) {
            if (0 === count($this->memberRepo->getTrustedMember($blog, $existingComment->getAuthor()))) {
                $this->addTrustedMember($blog, $existingComment->getAuthor());
            }
        }
        $this->om->flush();

        $this->trackingManager->dispatchCommentPublishEvent($existingComment->getPost(), $existingComment);

        return $existingComment;
    }
public function publishComment(Blog $blog, Comment $existingComment)
    {
        $existingComment->publish();
        if (BlogOptions::COMMENT_MODERATION_PRIOR_ONCE === $blog->getOptions()->getCommentModerationMode()
            && null !== $existingComment->getAuthor()) {
            if (0 === count($this->memberRepo->getTrustedMember($blog, $existingComment->getAuthor()))) {
                $this->addTrustedMember($blog, $existingComment->getAuthor());
            }
        }
        $this->om->flush();

        $this->trackingManager->dispatchCommentPublishEvent($existingComment->getPost(), $existingComment);

        return $existingComment;
    }
public function publishComment ( Blog $ blog , Comment $ existingComment ) { $ existingComment -> publish ( ) ; if ( BlogOptions :: COMMENT_MODERATION_PRIOR_ONCE === $ blog -> getOptions ( ) -> getCommentModerationMode ( ) && null !== $ existingComment -> getAuthor ( ) ) { if ( 0 === count ( $ this -> memberRepo -> getTrustedMember ( $ blog , $ existingComment -> getAuthor ( ) ) ) ) { $ this -> addTrustedMember ( $ blog , $ existingComment -> getAuthor ( ) ) ; } } $ this -> om -> flush ( ) ; $ this -> trackingManager -> dispatchCommentPublishEvent ( $ existingComment -> getPost ( ) , $ existingComment ) ; return $ existingComment ; }
Publish a comment.

@param Blog    $blog
@param Comment $existingComment

@return Comment
Publish a comment .