@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | use Core\Container; |
| 10 | 10 | use Core\Traits\StringFunctions; |
| 11 | 11 | |
| 12 | -class Comments extends AdminController{ |
|
| 12 | +class Comments extends AdminController { |
|
| 13 | 13 | |
| 14 | 14 | use StringFunctions; |
| 15 | 15 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | //update comment |
| 117 | - if($this->commentModel->update($commentId, $comment["commentTextArea"], $comment["commentApproved"])) |
|
| 117 | + if ($this->commentModel->update($commentId, $comment["commentTextArea"], $comment["commentApproved"])) |
|
| 118 | 118 | { |
| 119 | 119 | $this->alertBox->setAlert("Comment updated"); |
| 120 | 120 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use Core\Container; |
| 7 | 7 | use Core\Constant; |
| 8 | 8 | |
| 9 | -class CommentModel extends Model{ |
|
| 9 | +class CommentModel extends Model { |
|
| 10 | 10 | |
| 11 | 11 | private $commentTbl; |
| 12 | 12 | private $userTbl; |
@@ -136,9 +136,9 @@ discard block |
||
| 136 | 136 | * @return int |
| 137 | 137 | * @throws \Exception |
| 138 | 138 | */ |
| 139 | - public function addComment(int $postId, int $userId, string $message, bool $admin=false):int |
|
| 139 | + public function addComment(int $postId, int $userId, string $message, bool $admin = false):int |
|
| 140 | 140 | { |
| 141 | - $sql=" |
|
| 141 | + $sql = " |
|
| 142 | 142 | INSERT INTO $this->commentTbl (users_idusers, posts_idposts, comment, approved) |
| 143 | 143 | VALUES (:userId, :postId, :comment, :approved) |
| 144 | 144 | "; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $this->bind(':approved', $admin); |
| 150 | 150 | |
| 151 | 151 | $this->execute(); |
| 152 | - return (int)$this->dbh->lastInsertId(); |
|
| 152 | + return (int) $this->dbh->lastInsertId(); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | public function update(int $commentId, string $comment, bool $approved) |
| 181 | 181 | { |
| 182 | 182 | |
| 183 | - $sql=" |
|
| 183 | + $sql = " |
|
| 184 | 184 | UPDATE $this->commentTbl |
| 185 | 185 | SET |
| 186 | 186 | comment = :comment, |