@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * pour intialiser la ou les clauses where d'une requete |
115 | 115 | */ |
116 | 116 | public function where($champ, $cond, $champ_test, $closure = null) { |
117 | - if ( $closure === null) { |
|
117 | + if ($closure === null) { |
|
118 | 118 | $this->conditions[] = $champ.$cond.$champ_test; |
119 | 119 | } |
120 | 120 | else { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $this->conditions[] = $champ.$cond.$champ_test." ".$closure; |
133 | 133 | }*/ |
134 | 134 | |
135 | - if ( $closure === null) { |
|
135 | + if ($closure === null) { |
|
136 | 136 | $this->closure[] = ""; |
137 | 137 | } |
138 | 138 | else { |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | * fonction qui permet de récupérer un select fait sur une table |
162 | 162 | */ |
163 | 163 | public function get() { |
164 | - $requete = $this->req_beginning . implode(",", $this->select_champ) . " FROM " . implode(",", $this->table); |
|
164 | + $requete = $this->req_beginning.implode(",", $this->select_champ)." FROM ".implode(",", $this->table); |
|
165 | 165 | |
166 | 166 | if (!empty($this->conditions)) { |
167 | - $requete .= " WHERE ". implode(" ", $this->conditions); |
|
167 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | if (!empty($this->order_by)) { |
@@ -177,18 +177,18 @@ discard block |
||
177 | 177 | |
178 | 178 | public function getTest() { |
179 | 179 | $values = []; |
180 | - $requete = $this->req_beginning . implode(",", $this->select_champ) . " FROM " . implode(",", $this->table); |
|
180 | + $requete = $this->req_beginning.implode(",", $this->select_champ)." FROM ".implode(",", $this->table); |
|
181 | 181 | |
182 | 182 | if (!empty($this->conditions)) { |
183 | - $values = array_combine(str_replace(".", "", $this->champs),$this->value); |
|
183 | + $values = array_combine(str_replace(".", "", $this->champs), $this->value); |
|
184 | 184 | |
185 | 185 | $datas = []; |
186 | 186 | $count = count($this->champs); |
187 | - for ($i=0 ; $i<$count ; $i++) { |
|
187 | + for ($i = 0; $i < $count; $i++) { |
|
188 | 188 | $datas[] = $this->champs[$i]." ".$this->conditions[$i]." :".str_replace(".", "", $this->champs[$i])." ".$this->closure[$i]." "; |
189 | 189 | } |
190 | 190 | |
191 | - $requete .= " WHERE ". implode(" ", $datas); |
|
191 | + $requete .= " WHERE ".implode(" ", $datas); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | if (!empty($this->order_by)) { |
@@ -213,15 +213,15 @@ discard block |
||
213 | 213 | |
214 | 214 | $datas = []; |
215 | 215 | $count = count($this->champs); |
216 | - for ($i=0 ; $i<$count ; $i++) { |
|
216 | + for ($i = 0; $i < $count; $i++) { |
|
217 | 217 | $datas[] = $this->champs[$i]."=:".$this->champs[$i]; |
218 | 218 | } |
219 | 219 | |
220 | 220 | //si on a des conditions alors on sera dans un insert |
221 | - $requete = $this->req_beginning . implode(",", $this->table) . " SET " . implode(", ", $datas); |
|
221 | + $requete = $this->req_beginning.implode(",", $this->table)." SET ".implode(", ", $datas); |
|
222 | 222 | |
223 | 223 | if (!empty($this->conditions)) { |
224 | - $requete .= " WHERE " . implode(" ", $this->conditions); |
|
224 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | $this->prepare($requete, $values); |
@@ -232,10 +232,10 @@ discard block |
||
232 | 232 | * fonction utilisée pour finir un delete |
233 | 233 | */ |
234 | 234 | public function del() { |
235 | - $requete = $this->req_beginning . implode(",", $this->table); |
|
235 | + $requete = $this->req_beginning.implode(",", $this->table); |
|
236 | 236 | |
237 | 237 | if (!empty($this->conditions)) { |
238 | - $requete .= " WHERE " . implode(" ", $this->conditions); |
|
238 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | $this->query($requete); |