public function onSuccessCommentRemoval(Comment $comment, $id) { /** @var \Users\User $user */ $user = $this->user->getIdentity(); $pageLink = $this->linkGenerator->link('Pages:Front:Page:show', ['internal_id' => $comment->getPageId()]); $this->appEventLogger->saveLog(sprintf('User [%s#%s] <b>has REMOVED</b> the Comment [%s#] of Author [%s] on the <a href="%s">Page [%s#%s]</a>', $user->getId(), $user->getUsername(), $id, $comment->getAuthor(), $pageLink, $comment->getPageId(), $comment->getPageTitle()), 'page_comment_release', $user->getId()); }
private function refresh($message, $type, array $snippets = null) { if ($this->presenter->isAjax()) { if ($snippets === null) { return; } if (empty($snippets)) { $this->redrawControl(); return; } foreach ($snippets as $snippet) { $this->redrawControl($snippet); } } else { $this->flashMessage($message, $type); $this->redirect('this#comment-' . $this->comment->getId()); } }
/** * @param Comment $comment * @throws ActionFailedException */ public function remove(Comment $comment) { $id = $comment->getId(); $this->commentRemover->remove($comment); $this->onSuccessCommentRemoval($comment, $id); }
public function getList() { $comments = Comment::all(); $theme = "Admin"; return $this->View->make("CommentModule::CommentList", compact("theme", 'comments')); }
/** * @param Comment $reaction */ public function addReaction(Comment $reaction) { if ($reaction->getPageId() !== $this->page->getId()) { throw new WrongPageCommentReaction(); } $this->reactions->add($reaction); }