@@ -76,8 +76,7 @@ |
||
76 | 76 | |
77 | 77 | if ($id_page != 0) { |
78 | 78 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE ID_page=".$id_page); |
79 | - } |
|
80 | - else { |
|
79 | + } else { |
|
81 | 80 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE url LIKE '$url'"); |
82 | 81 | } |
83 | 82 |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | - * @param $table |
|
87 | + * @param string $table |
|
88 | 88 | * @return $this |
89 | 89 | * |
90 | 90 | * pour initialiser la les listes des tables ou il faudra aler chercher les données |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * @param $table |
|
99 | + * @param string $table |
|
100 | 100 | * |
101 | 101 | * pour initialiser la table dans laquelle on va insérer les données |
102 | 102 | */ |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | |
109 | 109 | /** |
110 | 110 | * @param $champ |
111 | - * @param $cond |
|
111 | + * @param string $cond |
|
112 | 112 | * @param $champ_test |
113 | 113 | * @param string $closure |
114 | - * @param null $no_bind |
|
114 | + * @param boolean $no_bind |
|
115 | 115 | * @return $this |
116 | 116 | * pour intialiser la ou les clauses where d'une requete |
117 | 117 | */ |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * @param $order |
|
133 | + * @param string $order |
|
134 | 134 | */ |
135 | 135 | public function orderBy($order) { |
136 | 136 | $this->order_by = " ORDER BY ".$order." "; |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | public function get() { |
153 | 153 | $values = []; |
154 | 154 | $datas = []; |
155 | - $requete = $this->req_beginning . implode(",", $this->select_champ) . " FROM " . implode(",", $this->table); |
|
155 | + $requete = $this->req_beginning.implode(",", $this->select_champ)." FROM ".implode(",", $this->table); |
|
156 | 156 | |
157 | 157 | if ((!empty($this->conditions)) || (!empty($this->conditions_table))) { |
158 | - $values = array_combine(str_replace(".", "", $this->champs),$this->value); |
|
158 | + $values = array_combine(str_replace(".", "", $this->champs), $this->value); |
|
159 | 159 | |
160 | 160 | $count = count($this->champs); |
161 | 161 | |
162 | - for ($i=0 ; $i<$count ; $i++) { |
|
162 | + for ($i = 0; $i < $count; $i++) { |
|
163 | 163 | $datas[] = $this->champs[$i]." ".$this->conditions[$i]." :".str_replace(".", "", $this->champs[$i])." ".$this->closure[$i]." "; |
164 | 164 | } |
165 | 165 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $datas[] = $cond; |
168 | 168 | } |
169 | 169 | |
170 | - $requete .= " WHERE ". implode(" ", $datas); |
|
170 | + $requete .= " WHERE ".implode(" ", $datas); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $requete .= $this->order_by; |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | |
187 | 187 | $datas = []; |
188 | 188 | $count = count($this->champs); |
189 | - for ($i=0 ; $i<$count ; $i++) { |
|
189 | + for ($i = 0; $i < $count; $i++) { |
|
190 | 190 | $datas[] = $this->champs[$i]."=:".$this->champs[$i]; |
191 | 191 | } |
192 | 192 | |
193 | 193 | //si on a des conditions alors on sera dans un insert |
194 | - $requete = $this->req_beginning . implode(",", $this->table) . " SET " . implode(", ", $datas); |
|
194 | + $requete = $this->req_beginning.implode(",", $this->table)." SET ".implode(", ", $datas); |
|
195 | 195 | |
196 | 196 | if (!empty($this->conditions)) { |
197 | - $requete .= " WHERE " . implode(" ", $this->conditions); |
|
197 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $this->prepare($requete, $values); |
@@ -205,10 +205,10 @@ discard block |
||
205 | 205 | * fonction utilisée pour finir un delete |
206 | 206 | */ |
207 | 207 | public function del() { |
208 | - $requete = $this->req_beginning . implode(",", $this->table); |
|
208 | + $requete = $this->req_beginning.implode(",", $this->table); |
|
209 | 209 | |
210 | 210 | if (!empty($this->conditions)) { |
211 | - $requete .= " WHERE " . implode(" ", $this->conditions); |
|
211 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | $this->query($requete); |