/** * Update * * @param GenericEvent $event * @return void */ public function update(GenericEvent $event) { $comment = $this->commentService->find($event['id']); $article = new \Article($comment->getLanguage()->getId(), $comment->getThread()->getNumber()); $authors = \ArticleAuthor::GetAuthorsByArticle($comment->getThread()->getNumber(), $comment->getLanguage()->getId()); $this->emailService->sendCommentNotification($comment, $article, $authors, $this->userService->getCurrentUser()); }
/** * Update * * @param GenericEvent $event * * @return void */ public function update(GenericEvent $event) { $comment = $this->commentService->find($event['id']); $article = $this->em->getRepository('Newscoop\\Entity\\Article')->getArticle($comment->getThread(), $comment->getLanguage()->getId())->getSingleResult(); try { $user = $this->userService->getCurrentUser(); } catch (AuthenticationException $e) { $user = null; } $authors = \ArticleAuthor::GetAuthorsByArticle($comment->getThread(), $comment->getLanguage()->getId()); $this->emailService->sendCommentNotification($comment, $article, $authors, $user); }