@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * fetches the result from an executed query |
| 100 | 100 | * @return array |
| 101 | 101 | */ |
| 102 | - protected function fetchAll(){ |
|
| 102 | + protected function fetchAll() { |
|
| 103 | 103 | return $this->stmt->fetchAll(); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * returns a single line from the executed query |
| 108 | 108 | * @return mixed |
| 109 | 109 | */ |
| 110 | - protected function fetch(){ |
|
| 110 | + protected function fetch() { |
|
| 111 | 111 | return $this->stmt->fetch(); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | if ($table === null) { |
| 133 | 133 | $reflect = new \ReflectionClass(get_class($this)); |
| 134 | 134 | $table = $reflect->getShortName(); //this is to only get the model name, otherwise we get the full namespace |
| 135 | - $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 |
|
| 135 | + $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 |
|
| 136 | 136 | $table = strtolower($table); //the database names are in lowercase |
| 137 | 137 | } |
| 138 | 138 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | //if we are here, then table doesn't exist, check for view |
| 154 | - $view = 'v_' . $table; |
|
| 154 | + $view = 'v_'.$table; |
|
| 155 | 155 | $stmt->bindValue(':table', $view, PDO::PARAM_STR); |
| 156 | 156 | $stmt->execute(); |
| 157 | 157 | $exists = $stmt->rowCount() > 0; //will return 1 if table exists or 0 if non existant |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | * @param $table string the table name |
| 173 | 173 | * @return string |
| 174 | 174 | */ |
| 175 | - protected function getTablePrefix($table){ |
|
| 176 | - if(Config::TABLE_PREFIX != '') |
|
| 175 | + protected function getTablePrefix($table) { |
|
| 176 | + if (Config::TABLE_PREFIX != '') |
|
| 177 | 177 | { |
| 178 | 178 | $table = Config::TABLE_PREFIX.'_'.$table; |
| 179 | 179 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | protected function getRowById($rowId, $table = ''): array |
| 245 | 245 | { |
| 246 | 246 | $tableName = $this->getTable($table); |
| 247 | - $idName = 'id' . $tableName; |
|
| 247 | + $idName = 'id'.$tableName; |
|
| 248 | 248 | $sql = "SELECT * FROM $tableName WHERE $idName = :rowId"; |
| 249 | 249 | $this->query($sql); |
| 250 | 250 | $this->bind(':rowId', $rowId); |