@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * fetches the result from an executed query |
| 102 | 102 | * @return array |
| 103 | 103 | */ |
| 104 | - protected function fetchAll(){ |
|
| 104 | + protected function fetchAll() { |
|
| 105 | 105 | return $this->stmt->fetchAll(); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * returns a single line from the executed query |
| 110 | 110 | * @return mixed |
| 111 | 111 | */ |
| 112 | - protected function fetch(){ |
|
| 112 | + protected function fetch() { |
|
| 113 | 113 | return $this->stmt->fetch(); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $table = $reflect->getShortName(); //this is to only get the model name, otherwise we get the full namespace |
| 137 | 137 | //since our models all end with Model, we should remove it. |
| 138 | 138 | $table = $this->removeFromEnd($table, 'Model'); |
| 139 | - $table = $table . 's'; //adding the s since the table should be plural. Might be some special case where the plural isn't just with an s |
|
| 139 | + $table = $table.'s'; //adding the s since the table should be plural. Might be some special case where the plural isn't just with an s |
|
| 140 | 140 | $table = strtolower($table); //the database names are in lowercase |
| 141 | 141 | } |
| 142 | 142 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | //if we are here, then table doesn't exist, check for view |
| 158 | - $view = 'v_' . $table; |
|
| 158 | + $view = 'v_'.$table; |
|
| 159 | 159 | $stmt->bindValue(':table', $view, PDO::PARAM_STR); |
| 160 | 160 | $stmt->execute(); |
| 161 | 161 | $exists = $stmt->rowCount() > 0; //will return 1 if table exists or 0 if non existant |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | * @param $table string the table name |
| 177 | 177 | * @return string |
| 178 | 178 | */ |
| 179 | - protected function getTablePrefix($table){ |
|
| 180 | - if(Config::TABLE_PREFIX != '') |
|
| 179 | + protected function getTablePrefix($table) { |
|
| 180 | + if (Config::TABLE_PREFIX != '') |
|
| 181 | 181 | { |
| 182 | 182 | $table = Config::TABLE_PREFIX.'_'.$table; |
| 183 | 183 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | protected function getRowById($rowId, $table = null): array |
| 249 | 249 | { |
| 250 | 250 | $tableName = $this->getTable($table); |
| 251 | - $idName = 'id' . $tableName; |
|
| 251 | + $idName = 'id'.$tableName; |
|
| 252 | 252 | $sql = "SELECT * FROM $tableName WHERE $idName = :rowId"; |
| 253 | 253 | $this->query($sql); |
| 254 | 254 | $this->bind(':rowId', $rowId); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $categories = $this->getResultSet('categories'); |
| 25 | 25 | foreach ($categories as $category) { |
| 26 | 26 | $data += [ |
| 27 | - $category->category_name => '/category/' . $category->categories_slug |
|
| 27 | + $category->category_name => '/category/'.$category->categories_slug |
|
| 28 | 28 | ]; |
| 29 | 29 | } |
| 30 | 30 | return $data; |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use Core\JsonException; |
| 7 | 7 | use Core\Traits\StringFunctions; |
| 8 | 8 | |
| 9 | -class Update extends AjaxController{ |
|
| 9 | +class Update extends AjaxController { |
|
| 10 | 10 | use StringFunctions; |
| 11 | 11 | |
| 12 | 12 | public function updateConfig() |
@@ -24,17 +24,17 @@ discard block |
||
| 24 | 24 | $configModel = new ConfigModel($this->container); |
| 25 | 25 | |
| 26 | 26 | $success = true; |
| 27 | - foreach ($configUpdate as $update){ |
|
| 27 | + foreach ($configUpdate as $update) { |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | if (!$configModel->updateConfig($update->dbId, $update->value)) { |
| 31 | 31 | $success = false; |
| 32 | 32 | $result['errorId'][] = $update->id; |
| 33 | - }else{ |
|
| 33 | + }else { |
|
| 34 | 34 | $result['successId'][] = $update->id; |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | - $result['success']=$success; |
|
| 37 | + $result['success'] = $success; |
|
| 38 | 38 | |
| 39 | 39 | echo json_encode($result); |
| 40 | 40 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | if ($success) { |
| 54 | 54 | $this->alertBox->setAlert('Configuration updates successfully'); |
| 55 | - } else { |
|
| 55 | + }else { |
|
| 56 | 56 | $this->alertBox->setAlert('error in configuration update', 'error'); |
| 57 | 57 | } |
| 58 | 58 | $this->container->getResponse()->redirect('admin/config'); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | if (!$configModel->updateConfig($update->dbId, $update->value)) { |
| 31 | 31 | $success = false; |
| 32 | 32 | $result['errorId'][] = $update->id; |
| 33 | - }else{ |
|
| 33 | + } else{ |
|
| 34 | 34 | $result['successId'][] = $update->id; |
| 35 | 35 | } |
| 36 | 36 | } |