/** * 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()); }
public function testSendPasswordRestoreToken() { $this->markTestSkipped(); // @todo refactor the view dependency $this->service->sendPasswordRestoreToken($this->user); $this->assertRegExp('#user/' . $this->user->getId() . '/token/[a-z0-9]{40}#i', $this->getEmailBody()); $this->assertArrayHasKey('Subject', $this->getEmailHeaders()); }
/** * 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); }