| @@ 257-267 (lines=11) @@ | ||
| 254 | $this->where[] = $cond; |
|
| 255 | if(func_num_args() > 1 && is_array($prepare)) |
|
| 256 | { |
|
| 257 | foreach($prepare as $key => $val) |
|
| 258 | { |
|
| 259 | if(isset($this->prepare[$key]) && $this->prepare[$key] != $val) |
|
| 260 | { |
|
| 261 | throw new \Exception('La clé '.$key.' pour la requête sql préparé est déjà utilisé avec une autre valeur.'); |
|
| 262 | } |
|
| 263 | else |
|
| 264 | { |
|
| 265 | $this->prepare[$key] = $val; |
|
| 266 | } |
|
| 267 | } |
|
| 268 | } |
|
| 269 | ||
| 270 | return $this; |
|
| @@ 306-316 (lines=11) @@ | ||
| 303 | public function addChamps($champs) |
|
| 304 | { |
|
| 305 | //Pour chaque champs |
|
| 306 | foreach($champs as $column => $data) |
|
| 307 | { |
|
| 308 | //Vérifie que le champ n'est pas déjà modifié |
|
| 309 | if(isset($this->champs[$column]) && $this->champs[$column] != $data) |
|
| 310 | { |
|
| 311 | throw new \Exception('Une valeur pour la colonne '.$column.' est déjà déclaré.'); |
|
| 312 | } |
|
| 313 | ||
| 314 | //On ajoute à la liste des champs à modifier. |
|
| 315 | $this->champs[$column] = $data; |
|
| 316 | } |
|
| 317 | ||
| 318 | return $this; |
|
| 319 | } |
|