1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Werkspot\KvkApi\Http\Search; |
6
|
|
|
|
7
|
|
|
final class SearchQuery implements QueryInterface |
8
|
|
|
{ |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @info KvK number, identifying number for a registration in the Netherlands Business Register. Consists of 8 digits |
12
|
|
|
* @var string |
13
|
|
|
*/ |
14
|
|
|
private $kvkNumber; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @info Branch number (Vestigingsnummer), identifying number of a branch. Consists of 12 digits |
18
|
|
|
* @var string |
19
|
|
|
*/ |
20
|
|
|
private $branchNumber; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @info RSIN is an identification number for legal entities and partnerships. Consist of only digits |
24
|
|
|
* @var int |
25
|
|
|
*/ |
26
|
|
|
private $rsin; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @info Street of an address |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
private $street; |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @info House number of an address |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
private $houseNumber; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @info Postal code or ZIP code, example 1000AA |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
private $postalCode; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @info City or Town name |
49
|
|
|
* @var string |
50
|
|
|
*/ |
51
|
|
|
private $city; |
52
|
|
|
|
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @info Indication to include searching through inactive dossiers/deregistered companies. |
56
|
|
|
* @note History of inactive companies is after 1 January 2012 |
57
|
|
|
* @var bool |
58
|
|
|
*/ |
59
|
|
|
private $includeInactiveRegistrations; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @info restrictToMainBranch Search is restricted to main branches. |
63
|
|
|
* @var bool |
64
|
|
|
*/ |
65
|
|
|
private $restrictToMainBranch; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @info Defines the search collection for the query |
69
|
|
|
* @var string |
70
|
|
|
*/ |
71
|
|
|
private $site; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @info User can optionally add a context to identify his result later on |
75
|
|
|
* @var string |
76
|
|
|
*/ |
77
|
|
|
private $context; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @info Free format text search for in the compiled search description. |
81
|
|
|
* @var string |
82
|
|
|
*/ |
83
|
|
|
private $q; |
84
|
|
|
|
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return string |
88
|
|
|
*/ |
89
|
|
|
public function getStreet(): string |
90
|
|
|
{ |
91
|
|
|
return $this->street; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @param string $street |
96
|
|
|
*/ |
97
|
|
|
public function setStreet(string $street): void |
98
|
|
|
{ |
99
|
|
|
$this->street = $street; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return string |
104
|
|
|
*/ |
105
|
|
|
public function getHouseNumber(): string |
106
|
|
|
{ |
107
|
|
|
return $this->houseNumber; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @param string $houseNumber |
112
|
|
|
*/ |
113
|
|
|
public function setHouseNumber(string $houseNumber): void |
114
|
|
|
{ |
115
|
|
|
$this->houseNumber = $houseNumber; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @return string |
120
|
|
|
*/ |
121
|
|
|
public function getKvkNumber(): string |
122
|
|
|
{ |
123
|
|
|
return $this->kvkNumber; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @param string $kvkNumber |
128
|
|
|
*/ |
129
|
|
|
public function setKvkNumber(string $kvkNumber): void |
130
|
|
|
{ |
131
|
|
|
$this->kvkNumber = $kvkNumber; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @return string |
136
|
|
|
*/ |
137
|
|
|
public function getBranchNumber(): string |
138
|
|
|
{ |
139
|
|
|
return $this->branchNumber; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @param string $branchNumber |
144
|
|
|
*/ |
145
|
|
|
public function setBranchNumber(string $branchNumber): void |
146
|
|
|
{ |
147
|
|
|
$this->branchNumber = $branchNumber; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @return int |
152
|
|
|
*/ |
153
|
|
|
public function getRsin(): int |
154
|
|
|
{ |
155
|
|
|
return $this->rsin; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @param int $rsin |
160
|
|
|
*/ |
161
|
|
|
public function setRsin(int $rsin): void |
162
|
|
|
{ |
163
|
|
|
$this->rsin = $rsin; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* @return string |
168
|
|
|
*/ |
169
|
|
|
public function getPostalCode(): string |
170
|
|
|
{ |
171
|
|
|
return $this->postalCode; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @param string $postalCode |
176
|
|
|
*/ |
177
|
|
|
public function setPostalCode(string $postalCode): void |
178
|
|
|
{ |
179
|
|
|
$this->postalCode = $postalCode; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* @return string |
184
|
|
|
*/ |
185
|
|
|
public function getCity(): string |
186
|
|
|
{ |
187
|
|
|
return $this->city; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* @param string $city |
192
|
|
|
*/ |
193
|
|
|
public function setCity(string $city): void |
194
|
|
|
{ |
195
|
|
|
$this->city = $city; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* @return bool |
200
|
|
|
*/ |
201
|
|
|
public function isIncludeInactiveRegistrations(): bool |
202
|
|
|
{ |
203
|
|
|
return $this->includeInactiveRegistrations; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @param bool $includeInactiveRegistrations |
208
|
|
|
*/ |
209
|
|
|
public function setIncludeInactiveRegistrations(bool $includeInactiveRegistrations): void |
210
|
|
|
{ |
211
|
|
|
$this->includeInactiveRegistrations = $includeInactiveRegistrations; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* @return bool |
216
|
|
|
*/ |
217
|
|
|
public function isRestrictToMainBranch(): bool |
218
|
|
|
{ |
219
|
|
|
return $this->restrictToMainBranch; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* @param bool $restrictToMainBranch |
224
|
|
|
*/ |
225
|
|
|
public function setRestrictToMainBranch(bool $restrictToMainBranch): void |
226
|
|
|
{ |
227
|
|
|
$this->restrictToMainBranch = $restrictToMainBranch; |
228
|
|
|
} |
229
|
|
|
|
230
|
|
|
/** |
231
|
|
|
* @return string |
232
|
|
|
*/ |
233
|
|
|
public function getSite(): string |
234
|
|
|
{ |
235
|
|
|
return $this->site; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* @param string $site |
240
|
|
|
*/ |
241
|
|
|
public function setSite(string $site): void |
242
|
|
|
{ |
243
|
|
|
$this->site = $site; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @return string |
248
|
|
|
*/ |
249
|
|
|
public function getContext(): string |
250
|
|
|
{ |
251
|
|
|
return $this->context; |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @param string $context |
256
|
|
|
*/ |
257
|
|
|
public function setContext(string $context): void |
258
|
|
|
{ |
259
|
|
|
$this->context = $context; |
260
|
|
|
} |
261
|
|
|
|
262
|
|
|
/** |
263
|
|
|
* @return string |
264
|
|
|
*/ |
265
|
|
|
public function getQ(): string |
266
|
|
|
{ |
267
|
|
|
return $this->q; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* @param string $q |
272
|
|
|
*/ |
273
|
|
|
public function setQ(string $q): void |
274
|
|
|
{ |
275
|
|
|
$this->q = $q; |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
public function get(): array |
279
|
|
|
{ |
280
|
|
|
return get_object_vars($this); |
281
|
|
|
} |
282
|
|
|
} |
283
|
|
|
|