@@ 177-192 (lines=16) @@ | ||
174 | * |
|
175 | * @return $this |
|
176 | */ |
|
177 | public function addQuotedColumns(array $columns): self |
|
178 | { |
|
179 | foreach ($columns as $columnName) { |
|
180 | if (isset($this->notQuotedColumns[$columnName])) { |
|
181 | throw new Exception( |
|
182 | 'The column '.$columnName.' is already declared to be a' |
|
183 | .' not quoted value.', |
|
184 | self::ERR_COLUMN_ALREADY_DEFINE_NOT_QUOTED |
|
185 | ); |
|
186 | } |
|
187 | ||
188 | $this->quotedColumns[$columnName] = true; |
|
189 | } |
|
190 | ||
191 | return $this; |
|
192 | } |
|
193 | ||
194 | /** |
|
195 | * Declare columns should not be automatic quoted if value is string. |
|
@@ 203-218 (lines=16) @@ | ||
200 | * |
|
201 | * @return $this |
|
202 | */ |
|
203 | public function addNotQuotedColumns(array $columns): self |
|
204 | { |
|
205 | foreach ($columns as $columnName) { |
|
206 | if (isset($this->quotedColumns[$columnName])) { |
|
207 | throw new Exception( |
|
208 | 'The column '.$columnName.' is already declared to be a' |
|
209 | .' quoted value.', |
|
210 | self::ERR_COLUMN_ALREADY_DEFINE_QUOTED |
|
211 | ); |
|
212 | } |
|
213 | ||
214 | $this->notQuotedColumns[$columnName] = true; |
|
215 | } |
|
216 | ||
217 | return $this; |
|
218 | } |
|
219 | ||
220 | /** |
|
221 | * Quote a value if need, else return the value passed in parameter |