Exemplo n.º 1
0
 /**
  * Add a new comment
  *
  * @param Comment $comment
  * @return Article
  */
 public function addComment(Comment $comment)
 {
     $comment->setArticle($this);
     $this->comments->add($comment);
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Create a new Comment, persist it
  *
  * @param Comment $comment
  */
 public function create(Comment $comment)
 {
     $comment->setCreatedDate(new DateTime());
     $this->em->persist($comment);
 }