Beispiel #1
0
 /**
  * @param \Sonata\NewsBundle\Model\CommentInterface $comment
  */
 public function sendCommentNotification(CommentInterface $comment)
 {
     $rendered = $this->templating->render($this->emails['notification']['template'], array('comment' => $comment, 'post' => $comment->getPost(), 'hash' => $this->hashGenerator->generate($comment), 'blog' => $this->blog));
     $this->sendEmailMessage($rendered, $this->emails['notification']['from'], $this->emails['notification']['emails']);
 }
 /**
  * @param \Sonata\NewsBundle\Model\CommentInterface $comment
  * @return string
  */
 public function generate(CommentInterface $comment)
 {
     return md5(sprintf('%s/%s/%s', $comment->getPost()->getId(), $comment->getId(), $this->salt));
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function addComments(CommentInterface $comment)
 {
     $this->comments[] = $comment;
     $comment->setPost($this);
 }