Conditions | 3 |
Paths | 3 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
47 | public function build() |
||
48 | { |
||
49 | // reset the parameterized values |
||
50 | $this->values = []; |
||
51 | |||
52 | // build each select query and concatenate |
||
53 | $queries = []; |
||
54 | foreach ($this->queries as $row) { |
||
55 | list($query, $type) = $row; |
||
56 | |||
57 | $prefix = 'UNION '; |
||
58 | if ($type) { |
||
59 | $prefix .= $type.' '; |
||
60 | } |
||
61 | |||
62 | $queries[] = $prefix.$query->build(); |
||
63 | |||
64 | $this->values = array_merge( |
||
65 | $this->values, |
||
66 | $query->getValues()); |
||
67 | } |
||
68 | |||
69 | return implode(' ', $queries); |
||
70 | } |
||
71 | } |
||
72 |