Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | protected function buildQuery(): string |
||
15 | { |
||
16 | $this->resetFields(); |
||
17 | $this->resetPreparedItems(); |
||
18 | |||
19 | $fields = array_map(function ($field) { |
||
20 | return "`{$field}`"; |
||
21 | }, $this->getFields()); |
||
22 | |||
23 | $queryParams = $this->iterateOverItems($this->getPreparedItems(), function ($iteration) use ($fields) { |
||
24 | return ':'.current($fields).'_'.$iteration; |
||
25 | }); |
||
26 | |||
27 | return sprintf( |
||
28 | self::QUERY_TEMPLATE, |
||
29 | $this->getTable(), |
||
30 | current($fields), |
||
31 | implode(',', $queryParams) |
||
32 | ); |
||
33 | } |
||
34 | |||
48 |