1 | <?php |
||
8 | class Criteria implements CriteriaInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $entityName; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $relations = []; |
||
19 | |||
20 | /** |
||
21 | * @var Config |
||
22 | */ |
||
23 | protected $config; |
||
24 | |||
25 | /** |
||
26 | * @var Select |
||
27 | */ |
||
28 | protected $select; |
||
29 | |||
30 | /** |
||
31 | * @param string $entityName |
||
32 | * @param Config $config |
||
33 | * @param Select $select |
||
34 | */ |
||
35 | public function __construct($entityName, Config $config, Select $select = null) |
||
46 | |||
47 | /** |
||
48 | * @return Select |
||
49 | */ |
||
50 | public function getQuery() |
||
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getEntityName() |
||
62 | |||
63 | /** |
||
64 | * @param string $entityName |
||
65 | * @return CriteriaInterface |
||
66 | */ |
||
67 | public function relation($entityName) |
||
110 | |||
111 | /** |
||
112 | * @param string $attribute |
||
113 | * @param bool|int|float|string $value |
||
114 | * @return $this |
||
115 | */ |
||
116 | public function equalTo($attribute, $value) |
||
122 | |||
123 | /** |
||
124 | * @param string $attribute |
||
125 | * @param bool|int|float|string $value |
||
126 | * @return $this |
||
127 | */ |
||
128 | public function notEqualTo($attribute, $value) |
||
134 | |||
135 | /** |
||
136 | * @param string $attribute |
||
137 | * @param int|float $value |
||
138 | * @return $this |
||
139 | */ |
||
140 | public function lessThan($attribute, $value) |
||
146 | |||
147 | /** |
||
148 | * @param string $attribute |
||
149 | * @param int|float $value |
||
150 | * @return $this |
||
151 | */ |
||
152 | public function greaterThan($attribute, $value) |
||
158 | |||
159 | /** |
||
160 | * @param string $attribute |
||
161 | * @param int|float $value |
||
162 | * @return $this |
||
163 | */ |
||
164 | public function greaterThanOrEqualTo($attribute, $value) |
||
170 | |||
171 | /** |
||
172 | * @param string $attribute |
||
173 | * @param int|float $value |
||
174 | * @return $this |
||
175 | */ |
||
176 | public function lessThanOrEqualTo($attribute, $value) |
||
182 | |||
183 | /** |
||
184 | * @param string $attribute |
||
185 | * @param int|float $value |
||
186 | * @return $this |
||
187 | */ |
||
188 | public function like($attribute, $value) |
||
194 | |||
195 | /** |
||
196 | * @param string $attribute |
||
197 | * @return $this |
||
198 | */ |
||
199 | public function isNull($attribute) |
||
205 | |||
206 | /** |
||
207 | * @param string $attribute |
||
208 | * @return $this |
||
209 | */ |
||
210 | public function isNotNull($attribute) |
||
216 | |||
217 | /** |
||
218 | * @param string $attribute |
||
219 | * @param array $values |
||
220 | * @return $this |
||
221 | */ |
||
222 | public function in($attribute, array $values) |
||
228 | |||
229 | /** |
||
230 | * @param string $attribute |
||
231 | * @param array $values |
||
232 | * @return $this |
||
233 | */ |
||
234 | public function notIn($attribute, array $values) |
||
240 | |||
241 | /** |
||
242 | * @param string $attribute |
||
243 | * @param int|float|string $minValue |
||
244 | * @param int|float|string $maxValue |
||
245 | * @return $this |
||
246 | */ |
||
247 | public function between($attribute, $minValue, $maxValue) |
||
253 | |||
254 | /** |
||
255 | * @param string $attribute |
||
256 | * @return $this |
||
257 | */ |
||
258 | public function order($attribute) |
||
278 | |||
279 | /** |
||
280 | * @param int $limit |
||
281 | * @return $this |
||
282 | */ |
||
283 | public function limit($limit) |
||
289 | |||
290 | /** |
||
291 | * @param int $offset |
||
292 | * @return $this |
||
293 | */ |
||
294 | public function offset($offset) |
||
300 | |||
301 | /** |
||
302 | * @param $attribute |
||
303 | * @return string |
||
304 | */ |
||
305 | public function getField($attribute) |
||
312 | } |
||
313 |