1 | <?php |
||
24 | class QueryBuilder |
||
25 | { |
||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | private $query = []; |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $sContext; |
||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $sPrefixedContext; |
||
38 | /** |
||
39 | * @var string|null |
||
40 | */ |
||
41 | private $sReturnedClass; |
||
42 | |||
43 | /** |
||
44 | * QueryBuilder constructor. |
||
45 | * |
||
46 | * @param string|null $returnedClass |
||
47 | * |
||
48 | * @throws \mrcnpdlk\MojePanstwo\Exception |
||
49 | */ |
||
50 | 7 | private function __construct(string $returnedClass) |
|
69 | |||
70 | /** |
||
71 | * @param string|null $returnedClass |
||
72 | * |
||
73 | * @return \mrcnpdlk\MojePanstwo\QueryBuilder |
||
74 | */ |
||
75 | 7 | static public function create(string $returnedClass) |
|
79 | |||
80 | /** |
||
81 | * @param string $layerName |
||
82 | * |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function addLayer(string $layerName) |
||
91 | |||
92 | /** |
||
93 | * Find object having ID |
||
94 | * |
||
95 | * @param string $id |
||
96 | * |
||
97 | * @return mixed |
||
98 | */ |
||
99 | 2 | public function find(string $id) |
|
108 | |||
109 | /** |
||
110 | * Search result |
||
111 | * |
||
112 | * @return SearchResponse |
||
113 | */ |
||
114 | 5 | public function get() |
|
146 | |||
147 | /** |
||
148 | * @return string |
||
149 | */ |
||
150 | 7 | public function getQuery() |
|
165 | |||
166 | /** |
||
167 | * @param int $limit |
||
168 | * |
||
169 | * @return $this |
||
170 | */ |
||
171 | 5 | public function limit(int $limit = 50) |
|
177 | |||
178 | /** |
||
179 | * @param string $property |
||
180 | * @param string $order |
||
181 | * |
||
182 | * @return $this |
||
183 | * @todo Zaimplementowac |
||
184 | */ |
||
185 | public function orderBy(string $property, string $order = 'asc') |
||
196 | |||
197 | /** |
||
198 | * @param int $page |
||
199 | * |
||
200 | * @return $this |
||
201 | */ |
||
202 | public function page(int $page = 1) |
||
208 | |||
209 | /** |
||
210 | * @param string $property |
||
211 | * @param $value |
||
212 | * |
||
213 | * @return $this |
||
214 | */ |
||
215 | public function where(string $property, $value) |
||
225 | |||
226 | } |
||
227 |