|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Serializer\Attribute\Groups; |
|
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\Post; |
|
|
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
|
|
13
|
|
|
use ApiPlatform\Metadata\Delete; |
|
|
|
|
|
|
14
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
|
|
15
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\DateFilter; |
|
|
|
|
|
|
16
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; |
|
|
|
|
|
|
17
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
|
|
18
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
|
|
|
|
|
19
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
|
|
|
20
|
|
|
use Doctrine\Common\Collections\Collection; |
|
|
|
|
|
|
21
|
|
|
use ControleOnline\Entity\Address; |
|
|
|
|
|
|
22
|
|
|
use ControleOnline\Entity\Config; |
|
|
|
|
|
|
23
|
|
|
use ControleOnline\Entity\Document; |
|
24
|
|
|
use ControleOnline\Entity\Email; |
|
25
|
|
|
use ControleOnline\Entity\File; |
|
|
|
|
|
|
26
|
|
|
use ControleOnline\Entity\Language; |
|
|
|
|
|
|
27
|
|
|
use ControleOnline\Entity\PeopleLink; |
|
28
|
|
|
use ControleOnline\Entity\Phone; |
|
29
|
|
|
use ControleOnline\Entity\User; |
|
|
|
|
|
|
30
|
|
|
use ControleOnline\Repository\PeopleRepository; |
|
31
|
|
|
use ControleOnline\Listener\LogListener; |
|
|
|
|
|
|
32
|
|
|
use ControleOnline\Controller\GetDefaultCompanyAction; |
|
33
|
|
|
use ControleOnline\Controller\GetMyCompaniesAction; |
|
34
|
|
|
use ControleOnline\Filter\CustomOrFilter; |
|
|
|
|
|
|
35
|
|
|
use DateTime; |
|
36
|
|
|
use DateTimeInterface; |
|
37
|
|
|
use stdClass; |
|
38
|
|
|
|
|
39
|
|
|
#[ORM\Table(name: 'people')] |
|
40
|
|
|
#[ORM\EntityListeners([LogListener::class])] |
|
41
|
|
|
#[ORM\Entity(repositoryClass: PeopleRepository::class)] |
|
42
|
|
|
#[ApiResource( |
|
43
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => 'text/csv'], |
|
44
|
|
|
normalizationContext: ['groups' => ['people:read']], |
|
45
|
|
|
denormalizationContext: ['groups' => ['people:write']], |
|
46
|
|
|
security: "is_granted('ROLE_CLIENT')", |
|
47
|
|
|
operations: [ |
|
48
|
|
|
new GetCollection( |
|
49
|
|
|
securityPostDenormalize: "is_granted('ROLE_CLIENT')" |
|
50
|
|
|
), |
|
51
|
|
|
new GetCollection( |
|
52
|
|
|
uriTemplate: '/people/company/default', |
|
53
|
|
|
controller: GetDefaultCompanyAction::class, |
|
54
|
|
|
security: "is_granted('PUBLIC_ACCESS')" |
|
55
|
|
|
), |
|
56
|
|
|
new GetCollection( |
|
57
|
|
|
uriTemplate: '/people/companies/my', |
|
58
|
|
|
controller: GetMyCompaniesAction::class, |
|
59
|
|
|
security: "is_granted('ROLE_CLIENT')" |
|
60
|
|
|
), |
|
61
|
|
|
new Get(security: "is_granted('PUBLIC_ACCESS')"), |
|
62
|
|
|
new Post(securityPostDenormalize: "is_granted('ROLE_CLIENT')"), |
|
63
|
|
|
new Put( |
|
64
|
|
|
security: "is_granted('ROLE_ADMIN') or is_granted('ROLE_CLIENT')", |
|
65
|
|
|
validationContext: ['groups' => ['people:write']], |
|
66
|
|
|
denormalizationContext: ['groups' => ['people:write']] |
|
67
|
|
|
), |
|
68
|
|
|
new Delete(security: "is_granted('ROLE_CLIENT')") |
|
69
|
|
|
] |
|
70
|
|
|
)] |
|
71
|
|
|
#[ApiFilter(CustomOrFilter::class, properties: ['name', 'id', 'alias'])] |
|
72
|
|
|
#[ApiFilter(SearchFilter::class, properties: [ |
|
73
|
|
|
'id' => 'exact', |
|
74
|
|
|
'enable' => 'exact', |
|
75
|
|
|
'name' => 'partial', |
|
76
|
|
|
'alias' => 'partial', |
|
77
|
|
|
'peopleType' => 'exact', |
|
78
|
|
|
'link.link_type' => 'exact', |
|
79
|
|
|
'link.company' => 'exact', |
|
80
|
|
|
'link.people' => 'exact', |
|
81
|
|
|
'user' => 'exact', |
|
82
|
|
|
'document' => 'exact', |
|
83
|
|
|
'address' => 'exact', |
|
84
|
|
|
'phone' => 'exact', |
|
85
|
|
|
'email' => 'exact' |
|
86
|
|
|
])] |
|
87
|
|
|
class People |
|
88
|
|
|
{ |
|
89
|
|
|
#[ORM\Column(type: 'integer', nullable: false)] |
|
90
|
|
|
#[ORM\Id] |
|
91
|
|
|
#[ORM\GeneratedValue(strategy: 'IDENTITY')] |
|
92
|
|
|
#[Groups([ |
|
93
|
|
|
'category:read', |
|
94
|
|
|
'connections:read', |
|
95
|
|
|
'order:read', |
|
96
|
|
|
'order_details:read', 'order:write', |
|
97
|
|
|
'order:write', |
|
98
|
|
|
'document:read', |
|
99
|
|
|
'email:read', |
|
100
|
|
|
'people:read', |
|
101
|
|
|
'contract:read', |
|
102
|
|
|
'people:write', |
|
103
|
|
|
'invoice:read', |
|
104
|
|
|
'invoice_details:read', |
|
105
|
|
|
'order_detail_status:read', |
|
106
|
|
|
'order_product_queue:read', |
|
107
|
|
|
'model:read', |
|
108
|
|
|
'model_detail:read', |
|
109
|
|
|
'user:read', |
|
110
|
|
|
'contract_people:read', |
|
111
|
|
|
'task:read', |
|
112
|
|
|
'task_interaction:read', |
|
113
|
|
|
'coupon:read', |
|
114
|
|
|
'logistic:read', |
|
115
|
|
|
'pruduct:read', |
|
116
|
|
|
'queue:read', |
|
117
|
|
|
'display:read', |
|
118
|
|
|
'notifications:read', |
|
119
|
|
|
'people_provider:read', |
|
120
|
|
|
'productsByDay:read' |
|
121
|
|
|
])] |
|
122
|
|
|
private $id; |
|
123
|
|
|
|
|
124
|
|
|
#[ORM\Column(type: 'boolean', nullable: false)] |
|
125
|
|
|
#[Groups([ |
|
126
|
|
|
'category:read', |
|
127
|
|
|
'connections:read', |
|
128
|
|
|
'order:read', |
|
129
|
|
|
'order_details:read', 'order:write', |
|
130
|
|
|
'order:write', |
|
131
|
|
|
'document:read', |
|
132
|
|
|
'email:read', |
|
133
|
|
|
'people:read', |
|
134
|
|
|
'contract:read', |
|
135
|
|
|
'people:write', |
|
136
|
|
|
'invoice:read', |
|
137
|
|
|
'invoice_details:read', |
|
138
|
|
|
'order_detail_status:read', |
|
139
|
|
|
'order_product_queue:read', |
|
140
|
|
|
'model:read', |
|
141
|
|
|
'model_detail:read', |
|
142
|
|
|
'user:read', |
|
143
|
|
|
'contract_people:read', |
|
144
|
|
|
'task:read', |
|
145
|
|
|
'task_interaction:read', |
|
146
|
|
|
'coupon:read', |
|
147
|
|
|
'logistic:read', |
|
148
|
|
|
'pruduct:read', |
|
149
|
|
|
'queue:read', |
|
150
|
|
|
'display:read', |
|
151
|
|
|
'notifications:read', |
|
152
|
|
|
'people_provider:read', |
|
153
|
|
|
'productsByDay:read' |
|
154
|
|
|
])] |
|
155
|
|
|
private $enable = 0; |
|
156
|
|
|
|
|
157
|
|
|
#[ORM\Column(type: 'string', length: 50, nullable: false)] |
|
158
|
|
|
#[Groups([ |
|
159
|
|
|
'category:read', |
|
160
|
|
|
'connections:read', |
|
161
|
|
|
'order:read', |
|
162
|
|
|
'order_details:read', 'order:write', |
|
163
|
|
|
'order:write', |
|
164
|
|
|
'document:read', |
|
165
|
|
|
'email:read', |
|
166
|
|
|
'people:read', |
|
167
|
|
|
'contract:read', |
|
168
|
|
|
'people:write', |
|
169
|
|
|
'invoice:read', |
|
170
|
|
|
'invoice_details:read', |
|
171
|
|
|
'order_detail_status:read', |
|
172
|
|
|
'order_product_queue:read', |
|
173
|
|
|
'model:read', |
|
174
|
|
|
'model_detail:read', |
|
175
|
|
|
'user:read', |
|
176
|
|
|
'contract_people:read', |
|
177
|
|
|
'task:read', |
|
178
|
|
|
'task_interaction:read', |
|
179
|
|
|
'coupon:read', |
|
180
|
|
|
'logistic:read', |
|
181
|
|
|
'pruduct:read', |
|
182
|
|
|
'queue:read', |
|
183
|
|
|
'display:read', |
|
184
|
|
|
'notifications:read', |
|
185
|
|
|
'people_provider:read', |
|
186
|
|
|
'productsByDay:read' |
|
187
|
|
|
])] |
|
188
|
|
|
private $name = ''; |
|
189
|
|
|
|
|
190
|
|
|
#[ORM\Column(type: 'datetime', nullable: false, columnDefinition: 'DATETIME')] |
|
191
|
|
|
private $registerDate; |
|
192
|
|
|
|
|
193
|
|
|
#[ORM\Column(type: 'string', length: 50, nullable: false)] |
|
194
|
|
|
#[Groups([ |
|
195
|
|
|
'category:read', |
|
196
|
|
|
'connections:read', |
|
197
|
|
|
'order:read', |
|
198
|
|
|
'order_details:read', 'order:write', |
|
199
|
|
|
'order:write', |
|
200
|
|
|
'document:read', |
|
201
|
|
|
'email:read', |
|
202
|
|
|
'people:read', |
|
203
|
|
|
'contract:read', |
|
204
|
|
|
'people:write', |
|
205
|
|
|
'invoice:read', |
|
206
|
|
|
'invoice_details:read', |
|
207
|
|
|
'order_detail_status:read', |
|
208
|
|
|
'order_product_queue:read', |
|
209
|
|
|
'model:read', |
|
210
|
|
|
'model_detail:read', |
|
211
|
|
|
'contract_people:read', |
|
212
|
|
|
'task:read', |
|
213
|
|
|
'task_interaction:read', |
|
214
|
|
|
'coupon:read', |
|
215
|
|
|
'logistic:read', |
|
216
|
|
|
'pruduct:read', |
|
217
|
|
|
'queue:read', |
|
218
|
|
|
'display:read', |
|
219
|
|
|
'notifications:read', |
|
220
|
|
|
'people_provider:read' |
|
221
|
|
|
])] |
|
222
|
|
|
private $alias = ''; |
|
223
|
|
|
|
|
224
|
|
|
#[ORM\Column(name: 'other_informations', type: 'json', nullable: true)] |
|
225
|
|
|
#[Groups([ |
|
226
|
|
|
'category:read', |
|
227
|
|
|
'connections:read', |
|
228
|
|
|
'order:read', |
|
229
|
|
|
'order_details:read', 'order:write', |
|
230
|
|
|
'order:write', |
|
231
|
|
|
'document:read', |
|
232
|
|
|
'email:read', |
|
233
|
|
|
'people:read', |
|
234
|
|
|
'people:write', |
|
235
|
|
|
'invoice:read', |
|
236
|
|
|
'invoice_details:read', |
|
237
|
|
|
'order_detail_status:read', |
|
238
|
|
|
'contract_people:read', |
|
239
|
|
|
'task:read', |
|
240
|
|
|
'task_interaction:read', |
|
241
|
|
|
'coupon:read', |
|
242
|
|
|
'logistic:read', |
|
243
|
|
|
'pruduct:read', |
|
244
|
|
|
'queue:read', |
|
245
|
|
|
'display:read', |
|
246
|
|
|
'notifications:read', |
|
247
|
|
|
'people_provider:read' |
|
248
|
|
|
])] |
|
249
|
|
|
private $otherInformations; |
|
250
|
|
|
|
|
251
|
|
|
#[ORM\Column(type: 'string', length: 1, nullable: false)] |
|
252
|
|
|
#[Groups([ |
|
253
|
|
|
'category:read', |
|
254
|
|
|
'connections:read', |
|
255
|
|
|
'order:read', |
|
256
|
|
|
'order_details:read', 'order:write', |
|
257
|
|
|
'order:write', |
|
258
|
|
|
'document:read', |
|
259
|
|
|
'email:read', |
|
260
|
|
|
'people:read', |
|
261
|
|
|
'contract:read', |
|
262
|
|
|
'people:write', |
|
263
|
|
|
'invoice:read', |
|
264
|
|
|
'invoice_details:read', |
|
265
|
|
|
'order_detail_status:read', |
|
266
|
|
|
'contract_people:read', |
|
267
|
|
|
'task:read', |
|
268
|
|
|
'task_interaction:read', |
|
269
|
|
|
'coupon:read', |
|
270
|
|
|
'logistic:read', |
|
271
|
|
|
'pruduct:read', |
|
272
|
|
|
'queue:read', |
|
273
|
|
|
'display:read', |
|
274
|
|
|
'notifications:read', |
|
275
|
|
|
'people_provider:read' |
|
276
|
|
|
])] |
|
277
|
|
|
private $peopleType = 'F'; |
|
278
|
|
|
|
|
279
|
|
|
#[ORM\ManyToOne(targetEntity: File::class, inversedBy: 'people')] |
|
280
|
|
|
#[ORM\JoinColumn(name: 'image_id', referencedColumnName: 'id')] |
|
281
|
|
|
#[Groups([ |
|
282
|
|
|
'category:read', |
|
283
|
|
|
'document:read', |
|
284
|
|
|
'email:read', |
|
285
|
|
|
'people:read', |
|
286
|
|
|
'people:write', |
|
287
|
|
|
'invoice:read', |
|
288
|
|
|
'invoice_details:read', |
|
289
|
|
|
'order_detail_status:read', |
|
290
|
|
|
'contract_people:read', |
|
291
|
|
|
'task_interaction:read', |
|
292
|
|
|
'coupon:read', |
|
293
|
|
|
'logistic:read', |
|
294
|
|
|
'pruduct:read', |
|
295
|
|
|
'queue:read', |
|
296
|
|
|
'display:read', |
|
297
|
|
|
'notifications:read', |
|
298
|
|
|
'people_provider:read' |
|
299
|
|
|
])] |
|
300
|
|
|
private $image; |
|
301
|
|
|
|
|
302
|
|
|
#[ORM\OneToMany(targetEntity: Config::class, mappedBy: 'people')] |
|
303
|
|
|
#[ORM\OrderBy(['configKey' => 'ASC'])] |
|
304
|
|
|
private $config; |
|
305
|
|
|
|
|
306
|
|
|
#[ORM\ManyToOne(targetEntity: File::class)] |
|
307
|
|
|
#[ORM\JoinColumn(name: 'alternative_image', referencedColumnName: 'id')] |
|
308
|
|
|
#[Groups([ |
|
309
|
|
|
'category:read', |
|
310
|
|
|
'document:read', |
|
311
|
|
|
'email:read', |
|
312
|
|
|
'people:read', |
|
313
|
|
|
'people:write', |
|
314
|
|
|
'invoice:read', |
|
315
|
|
|
'invoice_details:read', |
|
316
|
|
|
'order_detail_status:read', |
|
317
|
|
|
'task_interaction:read', |
|
318
|
|
|
'coupon:read', |
|
319
|
|
|
'logistic:read', |
|
320
|
|
|
'pruduct:read', |
|
321
|
|
|
'queue:read', |
|
322
|
|
|
'display:read', |
|
323
|
|
|
'notifications:read', |
|
324
|
|
|
'people_provider:read' |
|
325
|
|
|
])] |
|
326
|
|
|
private $alternative_image; |
|
327
|
|
|
|
|
328
|
|
|
#[ORM\ManyToOne(targetEntity: File::class)] |
|
329
|
|
|
#[ORM\JoinColumn(name: 'background_image', referencedColumnName: 'id')] |
|
330
|
|
|
#[Groups([ |
|
331
|
|
|
'category:read', |
|
332
|
|
|
'document:read', |
|
333
|
|
|
'email:read', |
|
334
|
|
|
'people:read', |
|
335
|
|
|
'people:write', |
|
336
|
|
|
'invoice:read', |
|
337
|
|
|
'invoice_details:read', |
|
338
|
|
|
'order_detail_status:read', |
|
339
|
|
|
'task_interaction:read', |
|
340
|
|
|
'coupon:read', |
|
341
|
|
|
'logistic:read', |
|
342
|
|
|
'pruduct:read', |
|
343
|
|
|
'queue:read', |
|
344
|
|
|
'display:read', |
|
345
|
|
|
'notifications:read', |
|
346
|
|
|
'people_provider:read' |
|
347
|
|
|
])] |
|
348
|
|
|
private $background; |
|
349
|
|
|
|
|
350
|
|
|
#[ORM\ManyToOne(targetEntity: Language::class, inversedBy: 'people')] |
|
351
|
|
|
#[ORM\JoinColumn(name: 'language_id', referencedColumnName: 'id')] |
|
352
|
|
|
private $language; |
|
353
|
|
|
|
|
354
|
|
|
#[ORM\OneToMany(targetEntity: PeopleLink::class, mappedBy: 'company')] |
|
355
|
|
|
private $company; |
|
356
|
|
|
|
|
357
|
|
|
#[ORM\OneToMany(targetEntity: PeopleLink::class, mappedBy: 'people')] |
|
358
|
|
|
private $link; |
|
359
|
|
|
|
|
360
|
|
|
#[ORM\OneToMany(targetEntity: User::class, mappedBy: 'people')] |
|
361
|
|
|
#[ORM\OrderBy(['username' => 'ASC'])] |
|
362
|
|
|
#[Groups([ |
|
363
|
|
|
'category:read', |
|
364
|
|
|
'document:read', |
|
365
|
|
|
'email:read', |
|
366
|
|
|
'people:read', |
|
367
|
|
|
'people:write', |
|
368
|
|
|
'order_detail_status:read', |
|
369
|
|
|
'task_interaction:read', |
|
370
|
|
|
'coupon:read', |
|
371
|
|
|
'logistic:read', |
|
372
|
|
|
'pruduct:read', |
|
373
|
|
|
'queue:read', |
|
374
|
|
|
'display:read', |
|
375
|
|
|
'notifications:read', |
|
376
|
|
|
'people_provider:read' |
|
377
|
|
|
])] |
|
378
|
|
|
private $user; |
|
379
|
|
|
|
|
380
|
|
|
#[ORM\OneToMany(targetEntity: Document::class, mappedBy: 'people')] |
|
381
|
|
|
#[Groups([ |
|
382
|
|
|
'category:read', |
|
383
|
|
|
'connections:read', |
|
384
|
|
|
'order:read', |
|
385
|
|
|
'order_details:read', 'order:write', |
|
386
|
|
|
'order:write', |
|
387
|
|
|
'document:read', |
|
388
|
|
|
'email:read', |
|
389
|
|
|
'people:read', |
|
390
|
|
|
'people:write', |
|
391
|
|
|
'order_detail_status:read', |
|
392
|
|
|
'task_interaction:read', |
|
393
|
|
|
'coupon:read', |
|
394
|
|
|
'logistic:read', |
|
395
|
|
|
'pruduct:read', |
|
396
|
|
|
'queue:read', |
|
397
|
|
|
'display:read', |
|
398
|
|
|
'notifications:read', |
|
399
|
|
|
'people_provider:read' |
|
400
|
|
|
])] |
|
401
|
|
|
private $document; |
|
402
|
|
|
|
|
403
|
|
|
#[ORM\OneToMany(targetEntity: Address::class, mappedBy: 'people')] |
|
404
|
|
|
#[ORM\OrderBy(['nickname' => 'ASC'])] |
|
405
|
|
|
#[Groups([ |
|
406
|
|
|
'category:read', |
|
407
|
|
|
'document:read', |
|
408
|
|
|
'email:read', |
|
409
|
|
|
'people:read', |
|
410
|
|
|
'people:write', |
|
411
|
|
|
'order_detail_status:read', |
|
412
|
|
|
'task_interaction:read', |
|
413
|
|
|
'coupon:read', |
|
414
|
|
|
'logistic:read', |
|
415
|
|
|
'pruduct:read', |
|
416
|
|
|
'queue:read', |
|
417
|
|
|
'display:read', |
|
418
|
|
|
'notifications:read', |
|
419
|
|
|
'people_provider:read' |
|
420
|
|
|
])] |
|
421
|
|
|
private $address; |
|
422
|
|
|
|
|
423
|
|
|
#[ORM\OneToMany(targetEntity: Phone::class, mappedBy: 'people')] |
|
424
|
|
|
#[Groups([ |
|
425
|
|
|
'category:read', |
|
426
|
|
|
'order_details:read', 'order:write', |
|
427
|
|
|
'order:write', |
|
428
|
|
|
'document:read', |
|
429
|
|
|
'email:read', |
|
430
|
|
|
'people:read', |
|
431
|
|
|
'people:write', |
|
432
|
|
|
'order_detail_status:read', |
|
433
|
|
|
'invoice_details:read', |
|
434
|
|
|
'task_interaction:read', |
|
435
|
|
|
'coupon:read', |
|
436
|
|
|
'logistic:read', |
|
437
|
|
|
'pruduct:read', |
|
438
|
|
|
'queue:read', |
|
439
|
|
|
'display:read', |
|
440
|
|
|
'notifications:read', |
|
441
|
|
|
'people_provider:read' |
|
442
|
|
|
])] |
|
443
|
|
|
private $phone; |
|
444
|
|
|
|
|
445
|
|
|
#[ORM\OneToMany(targetEntity: Email::class, mappedBy: 'people')] |
|
446
|
|
|
#[Groups([ |
|
447
|
|
|
'category:read', |
|
448
|
|
|
'order_details:read', 'order:write', |
|
449
|
|
|
'order:write', |
|
450
|
|
|
'document:read', |
|
451
|
|
|
'email:read', |
|
452
|
|
|
'people:read', |
|
453
|
|
|
'people:write', |
|
454
|
|
|
'order_detail_status:read', |
|
455
|
|
|
'invoice_details:read', |
|
456
|
|
|
'task_interaction:read', |
|
457
|
|
|
'coupon:read', |
|
458
|
|
|
'logistic:read', |
|
459
|
|
|
'pruduct:read', |
|
460
|
|
|
'queue:read', |
|
461
|
|
|
'display:read', |
|
462
|
|
|
'notifications:read', |
|
463
|
|
|
'people_provider:read' |
|
464
|
|
|
])] |
|
465
|
|
|
private $email; |
|
466
|
|
|
|
|
467
|
|
|
#[ORM\Column(type: 'datetime', nullable: false, columnDefinition: 'DATETIME')] |
|
468
|
|
|
#[Groups([ |
|
469
|
|
|
'category:read', |
|
470
|
|
|
'connections:read', |
|
471
|
|
|
'order:read', |
|
472
|
|
|
'order_details:read', 'order:write', |
|
473
|
|
|
'order:write', |
|
474
|
|
|
'document:read', |
|
475
|
|
|
'email:read', |
|
476
|
|
|
'people:read', |
|
477
|
|
|
'contract:read', |
|
478
|
|
|
'people:write', |
|
479
|
|
|
'invoice:read', |
|
480
|
|
|
'invoice_details:read', |
|
481
|
|
|
'order_detail_status:read', |
|
482
|
|
|
'task:read', |
|
483
|
|
|
'task_interaction:read', |
|
484
|
|
|
'coupon:read', |
|
485
|
|
|
'logistic:read', |
|
486
|
|
|
'pruduct:read', |
|
487
|
|
|
'queue:read', |
|
488
|
|
|
'display:read', |
|
489
|
|
|
'notifications:read', |
|
490
|
|
|
'people_provider:read' |
|
491
|
|
|
])] |
|
492
|
|
|
private $foundationDate = null; |
|
493
|
|
|
|
|
494
|
|
|
public function __construct() |
|
495
|
|
|
{ |
|
496
|
|
|
$this->enable = 0; |
|
497
|
|
|
$this->registerDate = new DateTime('now'); |
|
498
|
|
|
$this->company = new ArrayCollection(); |
|
499
|
|
|
$this->config = new ArrayCollection(); |
|
500
|
|
|
$this->link = new ArrayCollection(); |
|
501
|
|
|
$this->user = new ArrayCollection(); |
|
502
|
|
|
$this->document = new ArrayCollection(); |
|
503
|
|
|
$this->address = new ArrayCollection(); |
|
504
|
|
|
$this->email = new ArrayCollection(); |
|
505
|
|
|
$this->phone = new ArrayCollection(); |
|
506
|
|
|
$this->otherInformations = json_encode(new stdClass()); |
|
507
|
|
|
} |
|
508
|
|
|
|
|
509
|
|
|
public function getId() |
|
510
|
|
|
{ |
|
511
|
|
|
return $this->id; |
|
512
|
|
|
} |
|
513
|
|
|
|
|
514
|
|
|
public function getEnabled() |
|
515
|
|
|
{ |
|
516
|
|
|
return $this->enable; |
|
517
|
|
|
} |
|
518
|
|
|
|
|
519
|
|
|
public function setEnabled($enable) |
|
520
|
|
|
{ |
|
521
|
|
|
$this->enable = $enable ?: 0; |
|
522
|
|
|
return $this; |
|
523
|
|
|
} |
|
524
|
|
|
|
|
525
|
|
|
public function setPeopleType($people_type) |
|
526
|
|
|
{ |
|
527
|
|
|
$this->peopleType = $people_type; |
|
528
|
|
|
return $this; |
|
529
|
|
|
} |
|
530
|
|
|
|
|
531
|
|
|
public function getPeopleType() |
|
532
|
|
|
{ |
|
533
|
|
|
return $this->peopleType; |
|
534
|
|
|
} |
|
535
|
|
|
|
|
536
|
|
|
public function setName(string $name): self |
|
537
|
|
|
{ |
|
538
|
|
|
$this->name = $name; |
|
539
|
|
|
return $this; |
|
540
|
|
|
} |
|
541
|
|
|
|
|
542
|
|
|
public function getName(): string |
|
543
|
|
|
{ |
|
544
|
|
|
return strtoupper((string) $this->name); |
|
545
|
|
|
} |
|
546
|
|
|
|
|
547
|
|
|
public function setAlias($alias) |
|
548
|
|
|
{ |
|
549
|
|
|
$this->alias = $alias; |
|
550
|
|
|
return $this; |
|
551
|
|
|
} |
|
552
|
|
|
|
|
553
|
|
|
public function getAlias() |
|
554
|
|
|
{ |
|
555
|
|
|
return strtoupper((string) $this->alias); |
|
556
|
|
|
} |
|
557
|
|
|
|
|
558
|
|
|
public function setLanguage(Language $language = null) |
|
559
|
|
|
{ |
|
560
|
|
|
$this->language = $language; |
|
561
|
|
|
return $this; |
|
562
|
|
|
} |
|
563
|
|
|
|
|
564
|
|
|
public function getLanguage() |
|
565
|
|
|
{ |
|
566
|
|
|
return $this->language; |
|
567
|
|
|
} |
|
568
|
|
|
|
|
569
|
|
|
public function getRegisterDate(): DateTimeInterface |
|
570
|
|
|
{ |
|
571
|
|
|
return $this->registerDate; |
|
572
|
|
|
} |
|
573
|
|
|
|
|
574
|
|
|
public function setRegisterDate(DateTimeInterface $registerDate): self |
|
575
|
|
|
{ |
|
576
|
|
|
$this->registerDate = $registerDate; |
|
577
|
|
|
return $this; |
|
578
|
|
|
} |
|
579
|
|
|
|
|
580
|
|
|
public function addDocument(Document $document) |
|
581
|
|
|
{ |
|
582
|
|
|
$this->document[] = $document; |
|
583
|
|
|
return $this; |
|
584
|
|
|
} |
|
585
|
|
|
|
|
586
|
|
|
public function addCompany(People $company) |
|
587
|
|
|
{ |
|
588
|
|
|
$this->company[] = $company; |
|
589
|
|
|
return $this; |
|
590
|
|
|
} |
|
591
|
|
|
|
|
592
|
|
|
public function removeCompany(People $company) |
|
593
|
|
|
{ |
|
594
|
|
|
$this->company->removeElement($company); |
|
595
|
|
|
} |
|
596
|
|
|
|
|
597
|
|
|
public function getCompany() |
|
598
|
|
|
{ |
|
599
|
|
|
return $this->company; |
|
600
|
|
|
} |
|
601
|
|
|
|
|
602
|
|
|
public function addLink(People $link) |
|
603
|
|
|
{ |
|
604
|
|
|
$this->link[] = $link; |
|
605
|
|
|
return $this; |
|
606
|
|
|
} |
|
607
|
|
|
|
|
608
|
|
|
public function removeLink(People $link) |
|
609
|
|
|
{ |
|
610
|
|
|
$this->link->removeElement($link); |
|
611
|
|
|
} |
|
612
|
|
|
|
|
613
|
|
|
public function getLink() |
|
614
|
|
|
{ |
|
615
|
|
|
return $this->link; |
|
616
|
|
|
} |
|
617
|
|
|
|
|
618
|
|
|
public function addUser(User $user) |
|
619
|
|
|
{ |
|
620
|
|
|
$this->user[] = $user; |
|
621
|
|
|
return $this; |
|
622
|
|
|
} |
|
623
|
|
|
|
|
624
|
|
|
public function removeUser(User $user) |
|
625
|
|
|
{ |
|
626
|
|
|
$this->user->removeElement($user); |
|
627
|
|
|
} |
|
628
|
|
|
|
|
629
|
|
|
public function getUser() |
|
630
|
|
|
{ |
|
631
|
|
|
return $this->user; |
|
632
|
|
|
} |
|
633
|
|
|
|
|
634
|
|
|
public function getDocument() |
|
635
|
|
|
{ |
|
636
|
|
|
return $this->document; |
|
637
|
|
|
} |
|
638
|
|
|
|
|
639
|
|
|
public function getAddress() |
|
640
|
|
|
{ |
|
641
|
|
|
return $this->address; |
|
642
|
|
|
} |
|
643
|
|
|
|
|
644
|
|
|
public function getPhone() |
|
645
|
|
|
{ |
|
646
|
|
|
return $this->phone; |
|
647
|
|
|
} |
|
648
|
|
|
|
|
649
|
|
|
public function getEmail() |
|
650
|
|
|
{ |
|
651
|
|
|
return $this->email; |
|
652
|
|
|
} |
|
653
|
|
|
|
|
654
|
|
|
public function getFoundationDate(): ?DateTime |
|
655
|
|
|
{ |
|
656
|
|
|
return $this->foundationDate; |
|
657
|
|
|
} |
|
658
|
|
|
|
|
659
|
|
|
public function setFoundationDate(DateTimeInterface $date): self |
|
660
|
|
|
{ |
|
661
|
|
|
$this->foundationDate = $date; |
|
662
|
|
|
return $this; |
|
663
|
|
|
} |
|
664
|
|
|
|
|
665
|
|
|
public function getFullName(): string |
|
666
|
|
|
{ |
|
667
|
|
|
if ($this->getPeopleType() == 'F') { |
|
668
|
|
|
return trim((string) preg_replace('/[^A-Za-z\s]/', '', sprintf('%s %s', $this->getName(), $this->getAlias()))); |
|
669
|
|
|
} |
|
670
|
|
|
return trim((string) preg_replace('/[^A-Za-z\s]/', '', $this->getName())); |
|
671
|
|
|
} |
|
672
|
|
|
|
|
673
|
|
|
public function isPerson(): bool |
|
674
|
|
|
{ |
|
675
|
|
|
return $this->getPeopleType() == 'F'; |
|
676
|
|
|
} |
|
677
|
|
|
|
|
678
|
|
|
public function getOneEmail(): ?Email |
|
679
|
|
|
{ |
|
680
|
|
|
if (($email = $this->getEmail()->first()) === false) { |
|
681
|
|
|
return null; |
|
682
|
|
|
} |
|
683
|
|
|
return $email; |
|
684
|
|
|
} |
|
685
|
|
|
|
|
686
|
|
|
public function getOneDocument(): ?Document |
|
687
|
|
|
{ |
|
688
|
|
|
$documents = $this->getDocument()->filter(function ($peopleDocument) { |
|
689
|
|
|
if ($peopleDocument->getPeople()->getPeopleType() == 'F') { |
|
690
|
|
|
return $peopleDocument->getDocumentType()->getDocumentType() == 'CPF'; |
|
691
|
|
|
} |
|
692
|
|
|
return $peopleDocument->getDocumentType()->getDocumentType() == 'CNPJ'; |
|
693
|
|
|
}); |
|
694
|
|
|
return ($document = $documents->first()) === false ? null : $document; |
|
695
|
|
|
} |
|
696
|
|
|
|
|
697
|
|
|
public function getBirthdayAsString(): ?string |
|
698
|
|
|
{ |
|
699
|
|
|
if ($this->getFoundationDate() instanceof DateTimeInterface) { |
|
700
|
|
|
return $this->getFoundationDate()->format('Y-m-d'); |
|
701
|
|
|
} |
|
702
|
|
|
return null; |
|
703
|
|
|
} |
|
704
|
|
|
|
|
705
|
|
|
public function getOtherInformations($decode = false) |
|
706
|
|
|
{ |
|
707
|
|
|
return $decode ? (object) json_decode(is_array($this->otherInformations) ? json_encode($this->otherInformations) : $this->otherInformations) : $this->otherInformations; |
|
|
|
|
|
|
708
|
|
|
} |
|
709
|
|
|
|
|
710
|
|
|
public function addOtherInformations($key, $value) |
|
711
|
|
|
{ |
|
712
|
|
|
$otherInformations = $this->getOtherInformations(true); |
|
713
|
|
|
$otherInformations->{$key} = $value; |
|
714
|
|
|
$this->otherInformations = json_encode($otherInformations); |
|
715
|
|
|
return $this; |
|
716
|
|
|
} |
|
717
|
|
|
|
|
718
|
|
|
public function setOtherInformations(stdClass $otherInformations) |
|
719
|
|
|
{ |
|
720
|
|
|
$this->otherInformations = json_encode($otherInformations); |
|
721
|
|
|
return $this; |
|
722
|
|
|
} |
|
723
|
|
|
|
|
724
|
|
|
public function addConfig(Config $config) |
|
725
|
|
|
{ |
|
726
|
|
|
$this->config[] = $config; |
|
727
|
|
|
return $this; |
|
728
|
|
|
} |
|
729
|
|
|
|
|
730
|
|
|
public function removeConfig(Config $config) |
|
731
|
|
|
{ |
|
732
|
|
|
$this->config->removeElement($config); |
|
733
|
|
|
} |
|
734
|
|
|
|
|
735
|
|
|
public function getConfig() |
|
736
|
|
|
{ |
|
737
|
|
|
return $this->config; |
|
738
|
|
|
} |
|
739
|
|
|
|
|
740
|
|
|
public function getBackground() |
|
741
|
|
|
{ |
|
742
|
|
|
return $this->background; |
|
743
|
|
|
} |
|
744
|
|
|
|
|
745
|
|
|
public function setBackground($background): self |
|
746
|
|
|
{ |
|
747
|
|
|
$this->background = $background; |
|
748
|
|
|
return $this; |
|
749
|
|
|
} |
|
750
|
|
|
|
|
751
|
|
|
public function getImage() |
|
752
|
|
|
{ |
|
753
|
|
|
return $this->image; |
|
754
|
|
|
} |
|
755
|
|
|
|
|
756
|
|
|
public function setImage($image): self |
|
757
|
|
|
{ |
|
758
|
|
|
$this->image = $image; |
|
759
|
|
|
return $this; |
|
760
|
|
|
} |
|
761
|
|
|
|
|
762
|
|
|
public function getAlternativeImage() |
|
763
|
|
|
{ |
|
764
|
|
|
return $this->alternative_image; |
|
765
|
|
|
} |
|
766
|
|
|
|
|
767
|
|
|
public function setAlternativeImage($alternative_image): self |
|
768
|
|
|
{ |
|
769
|
|
|
$this->alternative_image = $alternative_image; |
|
770
|
|
|
return $this; |
|
771
|
|
|
} |
|
772
|
|
|
} |
|
773
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths