/** * Adds a Comment * * @param \TYPO3\T3extblog\Domain\Model\Comment $comment * @return void */ public function addComment(Comment $comment) { $this->initComments(); $comment->setPostId($this->getLocalizedUid()); $this->comments->attach($comment); $this->getCommentRepository()->add($comment); }