1 | <?php |
||
12 | class Query |
||
13 | { |
||
14 | protected $fields = []; |
||
15 | protected $table = ""; |
||
16 | protected $where = []; |
||
17 | protected $groupBy = []; |
||
18 | protected $orderBy = []; |
||
19 | protected $join = []; |
||
20 | |||
21 | protected $limitStart = null; |
||
22 | protected $limitEnd = null; |
||
23 | protected $top = null; |
||
24 | protected $forUpdate = false; |
||
25 | |||
26 | /** |
||
27 | * Example: |
||
28 | * $query->fields(['name', 'price']); |
||
29 | * |
||
30 | * @param array $fields |
||
31 | * @return $this |
||
32 | */ |
||
33 | public function fields(array $fields) |
||
39 | |||
40 | /** |
||
41 | * Example |
||
42 | * $query->table('product'); |
||
43 | * |
||
44 | * @param string $table |
||
45 | * @return $this |
||
46 | */ |
||
47 | public function table($table) |
||
53 | |||
54 | /** |
||
55 | * Example: |
||
56 | * $query->join('sales', 'product.id = sales.id'); |
||
57 | * |
||
58 | * @param string $table |
||
59 | * @param string $filter |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function join($table, $filter) |
||
67 | |||
68 | /** |
||
69 | * Example: |
||
70 | * $query->filter('price > [[amount]]', [ 'amount' => 1000] ); |
||
71 | * |
||
72 | * @param string $filter |
||
73 | * @param array $params |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function where($filter, array $params = []) |
||
81 | |||
82 | /** |
||
83 | * Example: |
||
84 | * $query->groupBy(['name']); |
||
85 | * |
||
86 | * @param array $fields |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function groupBy(array $fields) |
||
95 | |||
96 | /** |
||
97 | * Example: |
||
98 | * $query->orderBy(['price desc']); |
||
99 | * |
||
100 | * @param array $fields |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function orderBy(array $fields) |
||
109 | |||
110 | public function limit($start, $end) |
||
115 | |||
116 | public function top($top) |
||
121 | |||
122 | public function forUpdate() |
||
128 | |||
129 | protected function getFields() |
||
137 | |||
138 | protected function getJoin() |
||
146 | |||
147 | protected function getWhere() |
||
163 | |||
164 | /** |
||
165 | * @return array |
||
166 | */ |
||
167 | public function getSelect() |
||
194 | |||
195 | /** |
||
196 | * @return string |
||
197 | * @throws \Exception |
||
198 | */ |
||
199 | public function getInsert() |
||
213 | |||
214 | /** |
||
215 | * @return array |
||
216 | * @throws \Exception |
||
217 | */ |
||
218 | public function getUpdate() |
||
240 | |||
241 | |||
242 | } |
||
243 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.