public function addComment(
        $source,
        $context,
        $content,
        $authorToken,
        $authorName,
        $authorEmail,
        CommentInterface $parent = null
    ) {
        $comment = $this
            ->commentDirector
            ->create()
            ->setId(round(microtime(true) * 1000))
            ->setParent($parent)
            ->setSource($source)
            ->setAuthorToken($authorToken)
            ->setAuthorName($authorName)
            ->setAuthorEmail($authorEmail)
            ->setContent($content)
            ->setContext($context);

        $this
            ->commentDirector
            ->save($comment);

        $this
            ->commentEventDispatcher
            ->dispatchCommentOnAddEvent($comment);

        return $comment;
    }
public function addComment(
        $source,
        $context,
        $content,
        $authorToken,
        $authorName,
        $authorEmail,
        CommentInterface $parent = null
    ) {
        $comment = $this
            ->commentDirector
            ->create()
            ->setId(round(microtime(true) * 1000))
            ->setParent($parent)
            ->setSource($source)
            ->setAuthorToken($authorToken)
            ->setAuthorName($authorName)
            ->setAuthorEmail($authorEmail)
            ->setContent($content)
            ->setContext($context);

        $this
            ->commentDirector
            ->save($comment);

        $this
            ->commentEventDispatcher
            ->dispatchCommentOnAddEvent($comment);

        return $comment;
    }
public function addComment ( $ source , $ context , $ content , $ authorToken , $ authorName , $ authorEmail , CommentInterface $ parent = null ) { $ comment = $ this -> commentDirector -> create ( ) -> setId ( round ( microtime ( true ) * 1000 ) ) -> setParent ( $ parent ) -> setSource ( $ source ) -> setAuthorToken ( $ authorToken ) -> setAuthorName ( $ authorName ) -> setAuthorEmail ( $ authorEmail ) -> setContent ( $ content ) -> setContext ( $ context ) ; $ this -> commentDirector -> save ( $ comment ) ; $ this -> commentEventDispatcher -> dispatchCommentOnAddEvent ( $ comment ) ; return $ comment ; }
Add comment into source.

@param string                $source      Source
@param string                $context     Context
@param string                $content     Content
@param string                $authorToken Author token
@param string                $authorName  Author name
@param string                $authorEmail Author email
@param CommentInterface|null $parent      Parent

@return CommentInterface Commend added
Add comment into source .