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