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