1 | <?php |
||
7 | class QueryBuilder |
||
8 | { |
||
9 | /** @var Adapter */ |
||
10 | private $adapter; |
||
11 | |||
12 | /** @var string */ |
||
13 | private $entityName; |
||
14 | |||
15 | /** @var array */ |
||
16 | private $body = []; |
||
17 | |||
18 | /** @var Hydrator */ |
||
19 | private $hydrator; |
||
20 | |||
21 | 12 | public function __construct(Adapter $adapter, string $entityName, Hydrator $hydrator) |
|
27 | |||
28 | 1 | public function setMatch(string $field, string $value): self |
|
34 | |||
35 | 1 | public function setTerm(string $field, string $value): self |
|
41 | |||
42 | 1 | public function setRange(string $field, int $minValue, int $maxValue): self |
|
48 | |||
49 | 1 | public function setMust(string $field, string $value): self |
|
55 | |||
56 | 1 | public function setFilter(string $field, string $value): self |
|
62 | |||
63 | 1 | public function setMustNot(string $field, string $value): self |
|
69 | |||
70 | 1 | public function setShould(string $field, string $value): self |
|
76 | |||
77 | 1 | public function addOrderBy(string $sort, string $order = null): self |
|
83 | |||
84 | 1 | public function addGreaterThan(string $field, int $value): self |
|
90 | |||
91 | 1 | public function addLessThan(string $field, int $value): self |
|
97 | |||
98 | 1 | public function setFirstResult(int $firstResult): self |
|
104 | |||
105 | 1 | public function setMaxResults(int $maxResults): self |
|
111 | |||
112 | 12 | public function getQuery(): Query |
|
120 | |||
121 | 4 | private function setTerms(string $field, string $value) |
|
132 | } |
||
133 |