public function createAddCommentForm(Content $content, $user = null) {
        $comment = new Comment();
        $comment->setContent($content);
        if ($user !== 'anon.') {
            $comment->setEmail($user->getEmail());
        }
        $form = $this->form_factory->create(new CommentType(), $comment);
        
        return $form;
    }
public function createAddCommentForm(Content $content, $user = null) {
        $comment = new Comment();
        $comment->setContent($content);
        if ($user !== 'anon.') {
            $comment->setEmail($user->getEmail());
        }
        $form = $this->form_factory->create(new CommentType(), $comment);
        
        return $form;
    }
public function createAddCommentForm ( Content $ content , $ user = null ) { $ comment = new Comment ( ) ; $ comment -> setContent ( $ content ) ; if ( $ user !== 'anon.' ) { $ comment -> setEmail ( $ user -> getEmail ( ) ) ; } $ form = $ this -> form_factory -> create ( new CommentType ( ) , $ comment ) ; return $ form ; }
Creates a form to comment on a content.

@param Haven\CmsBundle\Entity\Content $content
@return Haven\CmsBundle\Form\CommentType $form
Creates a form to comment on a content .