/** * @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)); }
/** * @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']); }