AppBundle\Entity\Post::addComment PHP Method

addComment() public method

public addComment ( Comment $comment )
$comment Comment
    public function addComment(Comment $comment)
    {
        $this->comments->add($comment);
        $comment->setPost($this);
    }

Usage Example

コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function addComment(\AppBundle\Entity\Comment $comments)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'addComment', array($comments));
     return parent::addComment($comments);
 }