1 | <?php |
||
17 | abstract class SelectAbstract extends StatementAbstract implements SelectInterface{ |
||
18 | use WhereTrait; |
||
19 | |||
20 | protected $distinct = false; |
||
21 | |||
22 | protected $cols = []; |
||
23 | protected $from = []; |
||
24 | protected $orderby = []; |
||
25 | protected $groupby = []; |
||
26 | |||
27 | /** |
||
28 | * @return \chillerlan\Database\Query\SelectInterface |
||
29 | */ |
||
30 | public function distinct():SelectInterface{ |
||
35 | |||
36 | /** |
||
37 | * @param $expr1 |
||
38 | * @param null $expr2 |
||
39 | * @param null $func |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | protected function addColumn($expr1, $expr2 = null, $func = null){ |
||
59 | |||
60 | /** |
||
61 | * @param array $expressions |
||
62 | * |
||
63 | * @return \chillerlan\Database\Query\SelectInterface |
||
64 | */ |
||
65 | public function cols(array $expressions):SelectInterface{ |
||
84 | |||
85 | /** |
||
86 | * @param string $table |
||
87 | * @param string|null $ref |
||
88 | */ |
||
89 | protected function _addFrom(string $table, string $ref = null){ |
||
98 | |||
99 | /** |
||
100 | * @param array $expressions |
||
101 | * |
||
102 | * @return \chillerlan\Database\Query\SelectInterface |
||
103 | */ |
||
104 | public function from(array $expressions):SelectInterface{ |
||
126 | |||
127 | public function where($val1, $val2, $operator = '=', $bind = true, $join = 'AND'):SelectInterface{ |
||
130 | |||
131 | public function openBracket($join = null):SelectInterface{ |
||
134 | |||
135 | public function closeBracket():SelectInterface{ |
||
138 | |||
139 | /** |
||
140 | * @param int $limit |
||
141 | * |
||
142 | * @return \chillerlan\Database\Query\SelectInterface |
||
143 | */ |
||
144 | public function limit(int $limit):SelectInterface{ |
||
149 | |||
150 | /** |
||
151 | * @param int $offset |
||
152 | * |
||
153 | * @return \chillerlan\Database\Query\SelectInterface |
||
154 | */ |
||
155 | public function offset(int $offset):SelectInterface{ |
||
160 | |||
161 | /** |
||
162 | * @param array $expressions |
||
163 | * |
||
164 | * @return \chillerlan\Database\Query\SelectInterface |
||
165 | */ |
||
166 | public function orderby(array $expressions):SelectInterface{ |
||
188 | |||
189 | public function groupBy(array $expressions):SelectInterface{ |
||
197 | |||
198 | public function union():SelectInterface{ |
||
201 | |||
202 | } |
||
203 |
As per the PSR-2 coding standard, there must be a space after the
case
keyword, instead of the test immediately following it.To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.