@@ -24,8 +24,8 @@ |
||
24 | 24 | { |
25 | 25 | $this->onlyAdmin(); |
26 | 26 | $this->onlyPost(); |
27 | - $state = (bool)($this->request->getData("state") === 'true'); |
|
28 | - $commentId = (int)$this->request->getData("commentId"); |
|
27 | + $state = (bool) ($this->request->getData("state") === 'true'); |
|
28 | + $commentId = (int) $this->request->getData("commentId"); |
|
29 | 29 | |
30 | 30 | $result = array(); |
31 | 31 | $result["success"] = $this->commentModel->setApproved(!$state, $commentId); |
@@ -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; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function addComment(int $postId, int $userId, string $message):int |
139 | 139 | { |
140 | - $sql=" |
|
140 | + $sql = " |
|
141 | 141 | INSERT INTO $this->commentTbl (users_idusers, posts_idposts, comment, approved) |
142 | 142 | VALUES (:userId, :postId, :comment, 0) |
143 | 143 | "; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $this->bind(':comment', $message); |
148 | 148 | |
149 | 149 | $this->execute(); |
150 | - return (int)$this->dbh->lastInsertId(); |
|
150 | + return (int) $this->dbh->lastInsertId(); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |