@@ -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,11 +132,11 @@ 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 | |
139 | - if(Config::TABLE_PREFIX != '') |
|
139 | + if (Config::TABLE_PREFIX != '') |
|
140 | 140 | { |
141 | 141 | $table = Config::TABLE_PREFIX.'_'.$table; |
142 | 142 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | //if we are here, then table doesn't exist, check for view |
157 | - $view = 'v_' . $table; |
|
157 | + $view = 'v_'.$table; |
|
158 | 158 | $stmt->bindValue(':table', $view, PDO::PARAM_STR); |
159 | 159 | $stmt->execute(); |
160 | 160 | $exists = $stmt->rowCount() > 0; //will return 1 if table exists or 0 if non existant |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | protected function getRowById($rowId, $table = ''): array |
234 | 234 | { |
235 | 235 | $tableName = $this->getTable($table); |
236 | - $idName = 'id' . $tableName; |
|
236 | + $idName = 'id'.$tableName; |
|
237 | 237 | $sql = "SELECT * FROM $tableName WHERE $idName = :rowId"; |
238 | 238 | $this->query($sql); |
239 | 239 | $this->bind(':rowId', $rowId); |