|
9 | 9 | */ |
10 | 10 | namespace NilPortugues\SqlQueryBuilder\Builder; |
11 | 11 |
|
12 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\DeleteWriter; |
13 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\InsertWriter; |
14 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\IntersectWriter; |
15 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\MinusWriter; |
16 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\SelectWriter; |
17 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\UnionAllWriter; |
18 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\UnionWriter; |
19 | | -use NilPortugues\SqlQueryBuilder\Builder\Syntax\UpdateWriter; |
20 | 12 | use NilPortugues\SqlQueryBuilder\Builder\Syntax\WriterFactory; |
21 | 13 | use NilPortugues\SqlQueryBuilder\Manipulation\Delete; |
22 | 14 | use NilPortugues\SqlQueryBuilder\Manipulation\QueryInterface; |
@@ -189,62 +181,62 @@ public function write(QueryInterface $query, $resetPlaceholders = true) |
189 | 181 | switch ($query->partName()) { |
190 | 182 |
|
191 | 183 | case 'SELECT': |
192 | | - if (false === ($this->selectWriter instanceof SelectWriter)) { |
| 184 | + if (false === ($this->selectWriter instanceof Syntax\SelectWriter)) { |
193 | 185 | $this->selectWriter = WriterFactory::createSelectWriter($this, $this->placeholderWriter); |
194 | 186 | } |
195 | 187 |
|
196 | 188 | $sql = $this->selectWriter->writeSelect($query); |
197 | 189 | break; |
198 | 190 |
|
199 | 191 | case 'INSERT': |
200 | | - if (false === ($this->insertWriter instanceof InsertWriter)) { |
| 192 | + if (false === ($this->insertWriter instanceof Syntax\InsertWriter)) { |
201 | 193 | $this->insertWriter = WriterFactory::createInsertWriter($this, $this->placeholderWriter); |
202 | 194 | } |
203 | 195 |
|
204 | 196 | $sql = $this->insertWriter->writeInsert($query); |
205 | 197 | break; |
206 | 198 |
|
207 | 199 | case 'UPDATE': |
208 | | - if (false === ($this->updateWriter instanceof UpdateWriter)) { |
| 200 | + if (false === ($this->updateWriter instanceof Syntax\UpdateWriter)) { |
209 | 201 | $this->updateWriter = WriterFactory::createUpdateWriter($this, $this->placeholderWriter); |
210 | 202 | } |
211 | 203 |
|
212 | 204 | $sql = $this->updateWriter->writeUpdate($query); |
213 | 205 | break; |
214 | 206 |
|
215 | 207 | case 'DELETE': |
216 | | - if (false === ($this->deleteWriter instanceof DeleteWriter)) { |
| 208 | + if (false === ($this->deleteWriter instanceof Syntax\DeleteWriter)) { |
217 | 209 | $this->deleteWriter = WriterFactory::createDeleteWriter($this, $this->placeholderWriter); |
218 | 210 | } |
219 | 211 |
|
220 | 212 | $sql = $this->deleteWriter->writeDelete($query); |
221 | 213 | break; |
222 | 214 |
|
223 | 215 | case 'INTERSECT': |
224 | | - if (false === ($this->intersectWriter instanceof IntersectWriter)) { |
| 216 | + if (false === ($this->intersectWriter instanceof Syntax\IntersectWriter)) { |
225 | 217 | $this->intersectWriter = WriterFactory::createIntersectWriter($this); |
226 | 218 | } |
227 | 219 |
|
228 | 220 | $sql = $this->intersectWriter->writeIntersect($query); |
229 | 221 | break; |
230 | 222 |
|
231 | 223 | case 'MINUS': |
232 | | - if (false === ($this->minusWriter instanceof MinusWriter)) { |
| 224 | + if (false === ($this->minusWriter instanceof Syntax\MinusWriter)) { |
233 | 225 | $this->minusWriter = WriterFactory::createMinusWriter($this); |
234 | 226 | } |
235 | 227 |
|
236 | 228 | $sql = $this->minusWriter->writeMinus($query); |
237 | 229 | break; |
238 | 230 |
|
239 | 231 | case 'UNION': |
240 | | - if (false === ($this->unionWriter instanceof UnionWriter)) { |
| 232 | + if (false === ($this->unionWriter instanceof Syntax\UnionWriter)) { |
241 | 233 | $this->unionWriter = WriterFactory::createUnionWriter($this); |
242 | 234 | } |
243 | 235 | $sql = $this->unionWriter->writeUnion($query); |
244 | 236 | break; |
245 | 237 |
|
246 | 238 | case 'UNION ALL': |
247 | | - if (false === ($this->unionAllWriter instanceof UnionAllWriter)) { |
| 239 | + if (false === ($this->unionAllWriter instanceof Syntax\UnionAllWriter)) { |
248 | 240 | $this->unionAllWriter = WriterFactory::createUnionAllWriter($this); |
249 | 241 | } |
250 | 242 | $sql = $this->unionAllWriter->writeUnionAll($query); |
|
0 commit comments