|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Del\Person\Criteria; |
|
4
|
|
|
|
|
5
|
|
|
class PersonCriteria |
|
6
|
|
|
{ |
|
7
|
|
|
const ORDER_ASC = 'ASC'; |
|
8
|
|
|
const ORDER_DESC = 'DESC'; |
|
9
|
|
|
const ORDER_FIRSTNAME = 'firstname'; |
|
10
|
|
|
const ORDER_MIDDLENAME = 'middlename'; |
|
11
|
|
|
const ORDER_LASTNAME = 'state'; |
|
12
|
|
|
const ORDER_AKA = 'aka'; |
|
13
|
|
|
const ORDER_BIRTHPLACE = 'birthplace'; |
|
14
|
|
|
const ORDER_COUNTRY = 'country'; |
|
15
|
|
|
const ORDER_DOB = 'dob'; |
|
16
|
|
|
|
|
17
|
|
|
protected ?int $id = null; |
|
18
|
|
|
protected ?string $firstname = null; |
|
19
|
|
|
protected ?string $middlename = null; |
|
20
|
|
|
protected ?string $lastname = null; |
|
21
|
|
|
protected ?string $aka = null; |
|
22
|
|
|
protected ?string $birthplace = null; |
|
23
|
|
|
protected ?string $country = null; |
|
24
|
|
|
protected ?string $dob = null; |
|
25
|
|
|
protected ?int $limit = null; |
|
26
|
|
|
protected ?int $offset = null; |
|
27
|
|
|
protected ?string $order = null; |
|
28
|
|
|
protected ?string $orderDirection = null; |
|
29
|
|
|
|
|
30
|
|
|
public function hasOffset(): bool |
|
31
|
|
|
{ |
|
32
|
|
|
return $this->offset !== null; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
1 |
|
public function setOffset(int $offset): void |
|
36
|
|
|
{ |
|
37
|
1 |
|
$this->offset = $offset; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public function getOffset(): int |
|
41
|
|
|
{ |
|
42
|
|
|
return $this->offset; |
|
|
|
|
|
|
43
|
|
|
} |
|
44
|
1 |
|
|
|
45
|
|
|
public function hasLimit(): bool |
|
46
|
1 |
|
{ |
|
47
|
1 |
|
return $this->limit !== null; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function setLimit(int $limit): void |
|
|
|
|
|
|
51
|
|
|
{ |
|
52
|
|
|
$this->limit = $code; |
|
|
|
|
|
|
53
|
1 |
|
} |
|
54
|
|
|
|
|
55
|
1 |
|
public function getLimit(): int |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->limit; |
|
|
|
|
|
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function hasOrder(): bool |
|
61
|
1 |
|
{ |
|
62
|
|
|
return $this->order !== null; |
|
63
|
1 |
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function setOrder(string $order): void |
|
66
|
|
|
{ |
|
67
|
|
|
$this->order = $order; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
1 |
|
public function getOrder(): string |
|
71
|
|
|
{ |
|
72
|
1 |
|
return $this->order; |
|
|
|
|
|
|
73
|
1 |
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function getOrderDirection(): string |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->orderDirection; |
|
|
|
|
|
|
78
|
|
|
} |
|
79
|
1 |
|
|
|
80
|
|
|
public function setOrderDirection(string $orderDirection): void |
|
81
|
1 |
|
{ |
|
82
|
|
|
$this->orderDirection = $orderDirection; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
public function hasOrderDirection(): bool |
|
86
|
|
|
{ |
|
87
|
1 |
|
return $this->orderDirection !== null; |
|
88
|
|
|
} |
|
89
|
1 |
|
|
|
90
|
|
|
public function setPagination(int $page, int $limit): void |
|
91
|
|
|
{ |
|
92
|
|
|
$offset = ($limit * $page) - $limit; |
|
93
|
|
|
$this->setLimit($limit); |
|
94
|
|
|
$this->setOffset($offset); |
|
95
|
|
|
} |
|
96
|
1 |
|
|
|
97
|
|
|
public function getId(): int |
|
98
|
1 |
|
{ |
|
99
|
1 |
|
return $this->id; |
|
|
|
|
|
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
public function setId(int $id): void |
|
103
|
|
|
{ |
|
104
|
|
|
$this->id = $id; |
|
105
|
1 |
|
} |
|
106
|
|
|
|
|
107
|
1 |
|
public function hasId(): bool |
|
108
|
|
|
{ |
|
109
|
|
|
return $this->id != null; |
|
|
|
|
|
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
public function getFirstname(): string |
|
113
|
1 |
|
{ |
|
114
|
|
|
return $this->firstname; |
|
|
|
|
|
|
115
|
1 |
|
} |
|
116
|
|
|
|
|
117
|
|
|
public function setFirstname(string $firstname): void |
|
118
|
|
|
{ |
|
119
|
|
|
$this->firstname = $firstname; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
1 |
|
public function hasFirstname(): bool |
|
123
|
|
|
{ |
|
124
|
1 |
|
return $this->firstname != null; |
|
|
|
|
|
|
125
|
1 |
|
} |
|
126
|
|
|
|
|
127
|
|
|
public function getMiddlename(): string |
|
128
|
|
|
{ |
|
129
|
|
|
return $this->middlename; |
|
|
|
|
|
|
130
|
|
|
} |
|
131
|
1 |
|
|
|
132
|
|
|
public function setMiddlename(string $middlename): void |
|
133
|
1 |
|
{ |
|
134
|
|
|
$this->middlename = $middlename; |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
public function hasMiddlename(): bool |
|
138
|
|
|
{ |
|
139
|
|
|
return $this->middlename != null; |
|
|
|
|
|
|
140
|
1 |
|
} |
|
141
|
|
|
|
|
142
|
1 |
|
public function getLastname(): string |
|
143
|
1 |
|
{ |
|
144
|
1 |
|
return $this->lastname; |
|
|
|
|
|
|
145
|
1 |
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function setLastname(string $lastname): void |
|
148
|
|
|
{ |
|
149
|
|
|
$this->lastname = $lastname; |
|
150
|
1 |
|
} |
|
151
|
|
|
|
|
152
|
1 |
|
public function hasLastname(): bool |
|
153
|
|
|
{ |
|
154
|
|
|
return $this->lastname != null; |
|
|
|
|
|
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
public function getAka(): string |
|
158
|
|
|
{ |
|
159
|
2 |
|
return $this->aka; |
|
|
|
|
|
|
160
|
|
|
} |
|
161
|
2 |
|
|
|
162
|
2 |
|
public function setAka(string $aka): void |
|
163
|
|
|
{ |
|
164
|
|
|
$this->aka = $aka; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
public function hasAka(): bool |
|
168
|
1 |
|
{ |
|
169
|
|
|
return $this->aka != null; |
|
|
|
|
|
|
170
|
1 |
|
} |
|
171
|
|
|
|
|
172
|
|
|
public function getBirthplace(): string |
|
173
|
|
|
{ |
|
174
|
|
|
return $this->birthplace; |
|
|
|
|
|
|
175
|
|
|
} |
|
176
|
1 |
|
|
|
177
|
|
|
public function setBirthplace(string $birthplace): void |
|
178
|
1 |
|
{ |
|
179
|
|
|
$this->birthplace = $birthplace; |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
public function hasBirthplace(): bool |
|
183
|
|
|
{ |
|
184
|
|
|
return $this->birthplace != null; |
|
|
|
|
|
|
185
|
2 |
|
} |
|
186
|
|
|
|
|
187
|
2 |
|
public function getCountry(): string |
|
188
|
2 |
|
{ |
|
189
|
|
|
return $this->country; |
|
|
|
|
|
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
public function setCountry(string $country): void |
|
193
|
|
|
{ |
|
194
|
1 |
|
$this->country = $country; |
|
195
|
|
|
} |
|
196
|
1 |
|
|
|
197
|
|
|
public function hasCountry(): bool |
|
198
|
|
|
{ |
|
199
|
|
|
return $this->country != null; |
|
|
|
|
|
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
1 |
|
public function getDob(): string |
|
203
|
|
|
{ |
|
204
|
1 |
|
return $this->dob; |
|
|
|
|
|
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
public function setDob(string $dob): void |
|
208
|
|
|
{ |
|
209
|
|
|
$this->dob = $dob; |
|
210
|
|
|
} |
|
211
|
2 |
|
|
|
212
|
|
|
public function hasDob(): bool |
|
213
|
2 |
|
{ |
|
214
|
2 |
|
return $this->dob != null; |
|
|
|
|
|
|
215
|
|
|
} |
|
216
|
|
|
} |
|
217
|
|
|
|