public function deleteComment() { $commentArray = $this->getCommentInfoForDelete(); $comment = $commentArray['comment']; $commentEntity = $commentArray['commentEntity']; $this->deleteAttachmentFiles($comment); $this->commentService->deleteComment($comment->getId()); $commentCount = $this->commentService->findCommentCount($commentEntity->getEntityType(), $commentEntity->getEntityId()); if ($commentCount === 0) { $this->commentService->deleteCommentEntity($commentEntity->getId()); } $event = new OW_Event('base_delete_comment', array('entityType' => $commentEntity->getEntityType(), 'entityId' => $commentEntity->getEntityId(), 'userId' => $comment->getUserId(), 'commentId' => $comment->getId())); OW::getEventManager()->trigger($event); $this->getCommentList(); }