1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Loevgaard\PakkelabelsBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* @ORM\Entity |
10
|
|
|
* @ORM\Table(name="pakkelabels_labels") |
11
|
|
|
*/ |
12
|
|
|
class Label |
13
|
|
|
{ |
14
|
|
|
const STATUS_PENDING_NORMALIZATION = 'pending_normalization'; |
15
|
|
|
const STATUS_PENDING_CREATION = 'pending_creation'; |
16
|
|
|
const STATUS_ERROR = 'error'; |
17
|
|
|
const STATUS_SUCCESS = 'success'; |
18
|
|
|
|
19
|
|
|
const LABEL_FORMAT_A4_PDF = 'a4_pdf'; |
20
|
|
|
const LABEL_FORMAT_10_X_19_PDF = '10x19_pdf'; |
21
|
|
|
const LABEL_FORMAT_PNG = 'png'; |
22
|
|
|
const LABEL_FORMAT_ZPL = 'zpl'; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var int |
26
|
|
|
* |
27
|
|
|
* @ORM\Id |
28
|
|
|
* @ORM\GeneratedValue |
29
|
|
|
* @ORM\Column(type="integer") |
30
|
|
|
*/ |
31
|
|
|
protected $id; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* This is the shipment id from Pakkelabels. |
35
|
|
|
* |
36
|
|
|
* @var int |
37
|
|
|
* |
38
|
|
|
* @ORM\Column(type="integer", unique=true, nullable=true) |
39
|
|
|
*/ |
40
|
|
|
protected $externalId; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
* |
45
|
|
|
* @Assert\NotBlank() |
46
|
|
|
* |
47
|
|
|
* @ORM\Column(type="string") |
48
|
|
|
*/ |
49
|
|
|
protected $status; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var string |
53
|
|
|
* |
54
|
|
|
* @ORM\Column(type="text", nullable=true) |
55
|
|
|
*/ |
56
|
|
|
protected $error; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* The shipping method property is used in normalization. We check the mappings table to see |
60
|
|
|
* if there is a shipping method matching this. If there is, we will populate the product code |
61
|
|
|
* and services codes properties. |
62
|
|
|
* |
63
|
|
|
* @var string |
64
|
|
|
* |
65
|
|
|
* @ORM\Column(type="string", nullable=true) |
66
|
|
|
*/ |
67
|
|
|
protected $shippingMethod; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* This property indiciates whether this label is a return label or not. |
71
|
|
|
* |
72
|
|
|
* @var bool |
73
|
|
|
* |
74
|
|
|
* @Assert\NotNull() |
75
|
|
|
* |
76
|
|
|
* @ORM\Column(type="boolean") |
77
|
|
|
*/ |
78
|
|
|
protected $returnLabel; |
79
|
|
|
|
80
|
|
|
/************************** |
81
|
|
|
* Pakkelabels properties * |
82
|
|
|
*************************/ |
83
|
|
|
/** |
84
|
|
|
* @var string |
85
|
|
|
* |
86
|
|
|
* @ORM\Column(type="string", nullable=true) |
87
|
|
|
*/ |
88
|
|
|
protected $orderId; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var string |
92
|
|
|
* |
93
|
|
|
* @ORM\Column(type="string", nullable=true) |
94
|
|
|
*/ |
95
|
|
|
protected $reference; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @var string |
99
|
|
|
* |
100
|
|
|
* @ORM\Column(type="string", nullable=true) |
101
|
|
|
*/ |
102
|
|
|
protected $source; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @var bool |
106
|
|
|
* |
107
|
|
|
* @Assert\NotBlank() |
108
|
|
|
* |
109
|
|
|
* @ORM\Column(type="boolean") |
110
|
|
|
*/ |
111
|
|
|
protected $ownAgreement; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @var string |
115
|
|
|
* |
116
|
|
|
* @ORM\Column(type="string", nullable=true) |
117
|
|
|
*/ |
118
|
|
|
protected $labelFormat; |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @var string |
122
|
|
|
* |
123
|
|
|
* @ORM\Column(type="string", nullable=true) |
124
|
|
|
*/ |
125
|
|
|
protected $productCode; |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @var string |
129
|
|
|
* |
130
|
|
|
* @ORM\Column(type="string", nullable=true) |
131
|
|
|
*/ |
132
|
|
|
protected $serviceCodes; |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @var bool |
136
|
|
|
* |
137
|
|
|
* @Assert\NotBlank() |
138
|
|
|
* |
139
|
|
|
* @ORM\Column(type="boolean") |
140
|
|
|
*/ |
141
|
|
|
protected $automaticSelectServicePoint; |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @var string|null |
145
|
|
|
* |
146
|
|
|
* @ORM\Column(type="string", nullable=true) |
147
|
|
|
*/ |
148
|
|
|
protected $servicePointId; |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @var bool |
152
|
|
|
* |
153
|
|
|
* @Assert\NotBlank() |
154
|
|
|
* |
155
|
|
|
* @ORM\Column(type="boolean") |
156
|
|
|
*/ |
157
|
|
|
protected $smsNotification; |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @var bool |
161
|
|
|
* |
162
|
|
|
* @Assert\NotBlank() |
163
|
|
|
* |
164
|
|
|
* @ORM\Column(type="boolean") |
165
|
|
|
*/ |
166
|
|
|
protected $emailNotification; |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @var string |
170
|
|
|
* |
171
|
|
|
* @Assert\NotBlank() |
172
|
|
|
* |
173
|
|
|
* @ORM\Column(type="string") |
174
|
|
|
*/ |
175
|
|
|
protected $senderName; |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* @var string |
179
|
|
|
* |
180
|
|
|
* @Assert\NotBlank() |
181
|
|
|
* |
182
|
|
|
* @ORM\Column(type="string") |
183
|
|
|
*/ |
184
|
|
|
protected $senderAddress1; |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* @var string |
188
|
|
|
* |
189
|
|
|
* @ORM\Column(type="string", nullable=true) |
190
|
|
|
*/ |
191
|
|
|
protected $senderAddress2; |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* @var string |
195
|
|
|
* |
196
|
|
|
* @Assert\NotBlank() |
197
|
|
|
* |
198
|
|
|
* @ORM\Column(type="string") |
199
|
|
|
*/ |
200
|
|
|
protected $senderCountryCode; |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* @var string |
204
|
|
|
* |
205
|
|
|
* @Assert\NotBlank() |
206
|
|
|
* |
207
|
|
|
* @ORM\Column(type="string") |
208
|
|
|
*/ |
209
|
|
|
protected $senderZipCode; |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* @var string |
213
|
|
|
* |
214
|
|
|
* @Assert\NotBlank() |
215
|
|
|
* |
216
|
|
|
* @ORM\Column(type="string") |
217
|
|
|
*/ |
218
|
|
|
protected $senderCity; |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* @var string |
222
|
|
|
* |
223
|
|
|
* @ORM\Column(type="string", nullable=true) |
224
|
|
|
*/ |
225
|
|
|
protected $senderAttention; |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @var string |
229
|
|
|
* |
230
|
|
|
* @Assert\NotBlank() |
231
|
|
|
* |
232
|
|
|
* @ORM\Column(type="string") |
233
|
|
|
*/ |
234
|
|
|
protected $senderEmail; |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @var string |
238
|
|
|
* |
239
|
|
|
* @ORM\Column(type="string", nullable=true) |
240
|
|
|
*/ |
241
|
|
|
protected $senderTelephone; |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @var string |
245
|
|
|
* |
246
|
|
|
* @ORM\Column(type="string", nullable=true) |
247
|
|
|
*/ |
248
|
|
|
protected $senderMobile; |
249
|
|
|
|
250
|
|
|
/** |
251
|
|
|
* @var string |
252
|
|
|
* |
253
|
|
|
* @Assert\NotBlank() |
254
|
|
|
* |
255
|
|
|
* @ORM\Column(type="string") |
256
|
|
|
*/ |
257
|
|
|
protected $receiverName; |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* @var string |
261
|
|
|
* |
262
|
|
|
* @Assert\NotBlank() |
263
|
|
|
* |
264
|
|
|
* @ORM\Column(type="string") |
265
|
|
|
*/ |
266
|
|
|
protected $receiverAddress1; |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* @var string |
270
|
|
|
* |
271
|
|
|
* @ORM\Column(type="string", nullable=true) |
272
|
|
|
*/ |
273
|
|
|
protected $receiverAddress2; |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* @var string |
277
|
|
|
* |
278
|
|
|
* @Assert\NotBlank() |
279
|
|
|
* |
280
|
|
|
* @ORM\Column(type="string") |
281
|
|
|
*/ |
282
|
|
|
protected $receiverCountryCode; |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* @var string |
286
|
|
|
* |
287
|
|
|
* @Assert\NotBlank() |
288
|
|
|
* |
289
|
|
|
* @ORM\Column(type="string") |
290
|
|
|
*/ |
291
|
|
|
protected $receiverZipCode; |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* @var string |
295
|
|
|
* |
296
|
|
|
* @Assert\NotBlank() |
297
|
|
|
* |
298
|
|
|
* @ORM\Column(type="string") |
299
|
|
|
*/ |
300
|
|
|
protected $receiverCity; |
301
|
|
|
|
302
|
|
|
/** |
303
|
|
|
* @var string |
304
|
|
|
* |
305
|
|
|
* @ORM\Column(type="string", nullable=true) |
306
|
|
|
*/ |
307
|
|
|
protected $receiverAttention; |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* @var string |
311
|
|
|
* |
312
|
|
|
* @Assert\NotBlank() |
313
|
|
|
* |
314
|
|
|
* @ORM\Column(type="string") |
315
|
|
|
*/ |
316
|
|
|
protected $receiverEmail; |
317
|
|
|
|
318
|
|
|
/** |
319
|
|
|
* @var string |
320
|
|
|
* |
321
|
|
|
* @ORM\Column(type="string", nullable=true) |
322
|
|
|
*/ |
323
|
|
|
protected $receiverTelephone; |
324
|
|
|
|
325
|
|
|
/** |
326
|
|
|
* @var string |
327
|
|
|
* |
328
|
|
|
* @ORM\Column(type="string", nullable=true) |
329
|
|
|
*/ |
330
|
|
|
protected $receiverMobile; |
331
|
|
|
|
332
|
|
|
/** |
333
|
|
|
* @var string |
334
|
|
|
* |
335
|
|
|
* @ORM\Column(type="text", nullable=true) |
336
|
|
|
*/ |
337
|
|
|
protected $receiverInstruction; |
338
|
|
|
|
339
|
|
|
public function __construct() |
340
|
|
|
{ |
341
|
|
|
$this->status = static::STATUS_PENDING_NORMALIZATION; |
342
|
|
|
$this->smsNotification = false; |
343
|
|
|
$this->emailNotification = false; |
344
|
|
|
$this->automaticSelectServicePoint = true; |
345
|
|
|
$this->returnLabel = false; |
346
|
|
|
} |
347
|
|
|
|
348
|
|
|
public function arrayForApi(): array |
349
|
|
|
{ |
350
|
|
|
$data = [ |
351
|
|
|
'order_id' => $this->orderId, |
352
|
|
|
'reference' => $this->reference, |
353
|
|
|
'source' => $this->source, |
354
|
|
|
'own_agreement' => $this->ownAgreement, |
355
|
|
|
'label_format' => $this->labelFormat, |
356
|
|
|
'product_code' => $this->productCode, |
357
|
|
|
'service_codes' => $this->serviceCodes, |
358
|
|
|
'automatic_select_service_point' => $this->automaticSelectServicePoint, |
359
|
|
|
'sms_notification' => $this->smsNotification, |
360
|
|
|
'email_notification' => $this->emailNotification, |
361
|
|
|
'service_point' => [ |
362
|
|
|
'id' => $this->servicePointId, |
363
|
|
|
], |
364
|
|
|
'sender' => [ |
365
|
|
|
'name' => $this->senderName, |
366
|
|
|
'address1' => $this->senderAddress1, |
367
|
|
|
'address2' => $this->senderAddress2, |
368
|
|
|
'country_code' => $this->senderCountryCode, |
369
|
|
|
'zipcode' => $this->senderZipCode, |
370
|
|
|
'city' => $this->senderCity, |
371
|
|
|
'attention' => $this->senderAttention, |
372
|
|
|
'email' => $this->senderEmail, |
373
|
|
|
'telephone' => $this->senderTelephone, |
374
|
|
|
'mobile' => $this->senderMobile, |
375
|
|
|
], |
376
|
|
|
'receiver' => [ |
377
|
|
|
'name' => $this->receiverName, |
378
|
|
|
'address1' => $this->receiverAddress1, |
379
|
|
|
'address2' => $this->receiverAddress2, |
380
|
|
|
'country_code' => $this->receiverCountryCode, |
381
|
|
|
'zipcode' => $this->receiverZipCode, |
382
|
|
|
'city' => $this->receiverCity, |
383
|
|
|
'attention' => $this->receiverAttention, |
384
|
|
|
'email' => $this->receiverEmail, |
385
|
|
|
'telephone' => $this->receiverTelephone, |
386
|
|
|
'mobile' => $this->receiverMobile, |
387
|
|
|
'instruction' => $this->receiverInstruction, |
388
|
|
|
], |
389
|
|
|
'parcels' => [ |
390
|
|
|
[ |
391
|
|
|
'weight' => 1000, |
392
|
|
|
], |
393
|
|
|
], |
394
|
|
|
]; |
395
|
|
|
|
396
|
|
|
return $data; |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
public function markAsError(string $error) |
400
|
|
|
{ |
401
|
|
|
$this->error = $error; |
402
|
|
|
$this->status = static::STATUS_ERROR; |
403
|
|
|
} |
404
|
|
|
|
405
|
|
|
public function markAsSuccess() |
406
|
|
|
{ |
407
|
|
|
$this->error = null; |
408
|
|
|
$this->status = static::STATUS_SUCCESS; |
409
|
|
|
} |
410
|
|
|
|
411
|
|
|
public function resetStatus() |
412
|
|
|
{ |
413
|
|
|
$this->error = null; |
414
|
|
|
$this->status = static::STATUS_PENDING_NORMALIZATION; |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
public function isStatus(string $status): bool |
418
|
|
|
{ |
419
|
|
|
return $this->status === $status; |
420
|
|
|
} |
421
|
|
|
|
422
|
|
|
public function isSuccess(): bool |
423
|
|
|
{ |
424
|
|
|
return $this->isStatus(static::STATUS_SUCCESS); |
425
|
|
|
} |
426
|
|
|
|
427
|
|
|
public function isError(): bool |
428
|
|
|
{ |
429
|
|
|
return $this->isStatus(static::STATUS_ERROR); |
430
|
|
|
} |
431
|
|
|
|
432
|
|
|
public function getStatusTranslationKey(): string |
433
|
|
|
{ |
434
|
|
|
return 'label.status.'.$this->status; |
435
|
|
|
} |
436
|
|
|
|
437
|
|
|
/** |
438
|
|
|
* Returns the available label formats. |
439
|
|
|
* |
440
|
|
|
* @return array |
441
|
|
|
*/ |
442
|
|
|
public static function getLabelFormats(): array |
443
|
|
|
{ |
444
|
|
|
return [ |
445
|
|
|
self::LABEL_FORMAT_10_X_19_PDF => self::LABEL_FORMAT_10_X_19_PDF, |
446
|
|
|
self::LABEL_FORMAT_A4_PDF => self::LABEL_FORMAT_A4_PDF, |
447
|
|
|
self::LABEL_FORMAT_PNG => self::LABEL_FORMAT_PNG, |
448
|
|
|
self::LABEL_FORMAT_ZPL => self::LABEL_FORMAT_ZPL, |
449
|
|
|
]; |
450
|
|
|
} |
451
|
|
|
|
452
|
|
|
/** |
453
|
|
|
* Returns the available statuses |
454
|
|
|
* |
455
|
|
|
* @return array |
456
|
|
|
*/ |
457
|
|
|
public static function getStatuses(): array |
458
|
|
|
{ |
459
|
|
|
return [ |
460
|
|
|
self::STATUS_PENDING_NORMALIZATION => self::STATUS_PENDING_NORMALIZATION, |
461
|
|
|
self::STATUS_PENDING_CREATION => self::STATUS_PENDING_CREATION, |
462
|
|
|
self::STATUS_SUCCESS => self::STATUS_SUCCESS, |
463
|
|
|
self::STATUS_ERROR => self::STATUS_ERROR, |
464
|
|
|
]; |
465
|
|
|
} |
466
|
|
|
|
467
|
|
|
/********************* |
468
|
|
|
* Getters / Setters * |
469
|
|
|
********************/ |
470
|
|
|
|
471
|
|
|
/** |
472
|
|
|
* @return int |
473
|
|
|
*/ |
474
|
|
|
public function getId(): int |
475
|
|
|
{ |
476
|
|
|
return $this->id; |
477
|
|
|
} |
478
|
|
|
|
479
|
|
|
/** |
480
|
|
|
* @param int $id |
481
|
|
|
* |
482
|
|
|
* @return Label |
483
|
|
|
*/ |
484
|
|
|
public function setId(int $id) : Label |
485
|
|
|
{ |
486
|
|
|
$this->id = $id; |
487
|
|
|
|
488
|
|
|
return $this; |
489
|
|
|
} |
490
|
|
|
|
491
|
|
|
/** |
492
|
|
|
* @return int |
493
|
|
|
*/ |
494
|
|
|
public function getExternalId(): ?int |
495
|
|
|
{ |
496
|
|
|
return $this->externalId; |
497
|
|
|
} |
498
|
|
|
|
499
|
|
|
/** |
500
|
|
|
* @param int $externalId |
501
|
|
|
* |
502
|
|
|
* @return Label |
503
|
|
|
*/ |
504
|
|
|
public function setExternalId(int $externalId) : Label |
505
|
|
|
{ |
506
|
|
|
$this->externalId = $externalId; |
507
|
|
|
|
508
|
|
|
return $this; |
509
|
|
|
} |
510
|
|
|
|
511
|
|
|
/** |
512
|
|
|
* @return string |
513
|
|
|
*/ |
514
|
|
|
public function getStatus(): string |
515
|
|
|
{ |
516
|
|
|
return $this->status; |
517
|
|
|
} |
518
|
|
|
|
519
|
|
|
/** |
520
|
|
|
* @param string $status |
521
|
|
|
* |
522
|
|
|
* @return Label |
523
|
|
|
*/ |
524
|
|
|
public function setStatus(string $status) : Label |
525
|
|
|
{ |
526
|
|
|
$this->status = $status; |
527
|
|
|
|
528
|
|
|
return $this; |
529
|
|
|
} |
530
|
|
|
|
531
|
|
|
/** |
532
|
|
|
* @return string |
533
|
|
|
*/ |
534
|
|
|
public function getError(): ?string |
535
|
|
|
{ |
536
|
|
|
return $this->error; |
537
|
|
|
} |
538
|
|
|
|
539
|
|
|
/** |
540
|
|
|
* @param string $error |
541
|
|
|
* |
542
|
|
|
* @return Label |
543
|
|
|
*/ |
544
|
|
|
public function setError(string $error) : Label |
545
|
|
|
{ |
546
|
|
|
$this->error = $error; |
547
|
|
|
|
548
|
|
|
return $this; |
549
|
|
|
} |
550
|
|
|
|
551
|
|
|
/** |
552
|
|
|
* @return string |
553
|
|
|
*/ |
554
|
|
|
public function getShippingMethod(): ?string |
555
|
|
|
{ |
556
|
|
|
return $this->shippingMethod; |
557
|
|
|
} |
558
|
|
|
|
559
|
|
|
/** |
560
|
|
|
* @param string $shippingMethod |
561
|
|
|
* |
562
|
|
|
* @return Label |
563
|
|
|
*/ |
564
|
|
|
public function setShippingMethod(string $shippingMethod) : Label |
565
|
|
|
{ |
566
|
|
|
$this->shippingMethod = $shippingMethod; |
567
|
|
|
|
568
|
|
|
return $this; |
569
|
|
|
} |
570
|
|
|
|
571
|
|
|
/** |
572
|
|
|
* @return bool |
573
|
|
|
*/ |
574
|
|
|
public function isReturnLabel(): bool |
575
|
|
|
{ |
576
|
|
|
return $this->returnLabel; |
577
|
|
|
} |
578
|
|
|
|
579
|
|
|
/** |
580
|
|
|
* @param bool $returnLabel |
581
|
|
|
* |
582
|
|
|
* @return Label |
583
|
|
|
*/ |
584
|
|
|
public function setReturnLabel(bool $returnLabel) : Label |
585
|
|
|
{ |
586
|
|
|
$this->returnLabel = $returnLabel; |
587
|
|
|
|
588
|
|
|
return $this; |
589
|
|
|
} |
590
|
|
|
|
591
|
|
|
/** |
592
|
|
|
* @return string |
593
|
|
|
*/ |
594
|
|
|
public function getOrderId(): ?string |
595
|
|
|
{ |
596
|
|
|
return $this->orderId; |
597
|
|
|
} |
598
|
|
|
|
599
|
|
|
/** |
600
|
|
|
* @param string $orderId |
601
|
|
|
* |
602
|
|
|
* @return Label |
603
|
|
|
*/ |
604
|
|
|
public function setOrderId(string $orderId) : Label |
605
|
|
|
{ |
606
|
|
|
$this->orderId = $orderId; |
607
|
|
|
|
608
|
|
|
return $this; |
609
|
|
|
} |
610
|
|
|
|
611
|
|
|
/** |
612
|
|
|
* @return string |
613
|
|
|
*/ |
614
|
|
|
public function getReference(): ?string |
615
|
|
|
{ |
616
|
|
|
return $this->reference; |
617
|
|
|
} |
618
|
|
|
|
619
|
|
|
/** |
620
|
|
|
* @param string $reference |
621
|
|
|
* |
622
|
|
|
* @return Label |
623
|
|
|
*/ |
624
|
|
|
public function setReference(string $reference) : Label |
625
|
|
|
{ |
626
|
|
|
$this->reference = $reference; |
627
|
|
|
|
628
|
|
|
return $this; |
629
|
|
|
} |
630
|
|
|
|
631
|
|
|
/** |
632
|
|
|
* @return string |
633
|
|
|
*/ |
634
|
|
|
public function getSource(): ?string |
635
|
|
|
{ |
636
|
|
|
return $this->source; |
637
|
|
|
} |
638
|
|
|
|
639
|
|
|
/** |
640
|
|
|
* @param string $source |
641
|
|
|
* |
642
|
|
|
* @return Label |
643
|
|
|
*/ |
644
|
|
|
public function setSource(string $source) : Label |
645
|
|
|
{ |
646
|
|
|
$this->source = $source; |
647
|
|
|
|
648
|
|
|
return $this; |
649
|
|
|
} |
650
|
|
|
|
651
|
|
|
/** |
652
|
|
|
* @return bool |
653
|
|
|
*/ |
654
|
|
|
public function isOwnAgreement(): bool |
655
|
|
|
{ |
656
|
|
|
return $this->ownAgreement; |
657
|
|
|
} |
658
|
|
|
|
659
|
|
|
/** |
660
|
|
|
* @param bool $ownAgreement |
661
|
|
|
* |
662
|
|
|
* @return Label |
663
|
|
|
*/ |
664
|
|
|
public function setOwnAgreement(bool $ownAgreement) : Label |
665
|
|
|
{ |
666
|
|
|
$this->ownAgreement = $ownAgreement; |
667
|
|
|
|
668
|
|
|
return $this; |
669
|
|
|
} |
670
|
|
|
|
671
|
|
|
/** |
672
|
|
|
* @return string |
673
|
|
|
*/ |
674
|
|
|
public function getLabelFormat(): ?string |
675
|
|
|
{ |
676
|
|
|
return $this->labelFormat; |
677
|
|
|
} |
678
|
|
|
|
679
|
|
|
/** |
680
|
|
|
* @param string $labelFormat |
681
|
|
|
* |
682
|
|
|
* @return Label |
683
|
|
|
*/ |
684
|
|
|
public function setLabelFormat(string $labelFormat) : Label |
685
|
|
|
{ |
686
|
|
|
$this->labelFormat = $labelFormat; |
687
|
|
|
|
688
|
|
|
return $this; |
689
|
|
|
} |
690
|
|
|
|
691
|
|
|
/** |
692
|
|
|
* @return string |
693
|
|
|
*/ |
694
|
|
|
public function getProductCode(): string |
695
|
|
|
{ |
696
|
|
|
return $this->productCode; |
697
|
|
|
} |
698
|
|
|
|
699
|
|
|
/** |
700
|
|
|
* @param string $productCode |
701
|
|
|
* |
702
|
|
|
* @return Label |
703
|
|
|
*/ |
704
|
|
|
public function setProductCode(string $productCode) : Label |
705
|
|
|
{ |
706
|
|
|
$this->productCode = $productCode; |
707
|
|
|
|
708
|
|
|
return $this; |
709
|
|
|
} |
710
|
|
|
|
711
|
|
|
/** |
712
|
|
|
* @return string |
713
|
|
|
*/ |
714
|
|
|
public function getServiceCodes(): string |
715
|
|
|
{ |
716
|
|
|
return $this->serviceCodes; |
717
|
|
|
} |
718
|
|
|
|
719
|
|
|
/** |
720
|
|
|
* @param string $serviceCodes |
721
|
|
|
* |
722
|
|
|
* @return Label |
723
|
|
|
*/ |
724
|
|
|
public function setServiceCodes(string $serviceCodes) : Label |
725
|
|
|
{ |
726
|
|
|
$this->serviceCodes = $serviceCodes; |
727
|
|
|
|
728
|
|
|
return $this; |
729
|
|
|
} |
730
|
|
|
|
731
|
|
|
/** |
732
|
|
|
* @return bool |
733
|
|
|
*/ |
734
|
|
|
public function isAutomaticSelectServicePoint(): bool |
735
|
|
|
{ |
736
|
|
|
return $this->automaticSelectServicePoint; |
737
|
|
|
} |
738
|
|
|
|
739
|
|
|
/** |
740
|
|
|
* @param bool $automaticSelectServicePoint |
741
|
|
|
* |
742
|
|
|
* @return Label |
743
|
|
|
*/ |
744
|
|
|
public function setAutomaticSelectServicePoint(bool $automaticSelectServicePoint) : Label |
745
|
|
|
{ |
746
|
|
|
$this->automaticSelectServicePoint = $automaticSelectServicePoint; |
747
|
|
|
|
748
|
|
|
return $this; |
749
|
|
|
} |
750
|
|
|
|
751
|
|
|
/** |
752
|
|
|
* @return string |
753
|
|
|
*/ |
754
|
|
|
public function getServicePointId(): ?string |
755
|
|
|
{ |
756
|
|
|
return $this->servicePointId; |
757
|
|
|
} |
758
|
|
|
|
759
|
|
|
/** |
760
|
|
|
* @param string $servicePointId |
761
|
|
|
* |
762
|
|
|
* @return Label |
763
|
|
|
*/ |
764
|
|
|
public function setServicePointId(string $servicePointId) : Label |
765
|
|
|
{ |
766
|
|
|
$this->servicePointId = $servicePointId; |
767
|
|
|
|
768
|
|
|
return $this; |
769
|
|
|
} |
770
|
|
|
|
771
|
|
|
/** |
772
|
|
|
* @return bool |
773
|
|
|
*/ |
774
|
|
|
public function isSmsNotification(): bool |
775
|
|
|
{ |
776
|
|
|
return $this->smsNotification; |
777
|
|
|
} |
778
|
|
|
|
779
|
|
|
/** |
780
|
|
|
* @param bool $smsNotification |
781
|
|
|
* |
782
|
|
|
* @return Label |
783
|
|
|
*/ |
784
|
|
|
public function setSmsNotification(bool $smsNotification) : Label |
785
|
|
|
{ |
786
|
|
|
$this->smsNotification = $smsNotification; |
787
|
|
|
|
788
|
|
|
return $this; |
789
|
|
|
} |
790
|
|
|
|
791
|
|
|
/** |
792
|
|
|
* @return bool |
793
|
|
|
*/ |
794
|
|
|
public function isEmailNotification(): bool |
795
|
|
|
{ |
796
|
|
|
return $this->emailNotification; |
797
|
|
|
} |
798
|
|
|
|
799
|
|
|
/** |
800
|
|
|
* @param bool $emailNotification |
801
|
|
|
* |
802
|
|
|
* @return Label |
803
|
|
|
*/ |
804
|
|
|
public function setEmailNotification(bool $emailNotification) : Label |
805
|
|
|
{ |
806
|
|
|
$this->emailNotification = $emailNotification; |
807
|
|
|
|
808
|
|
|
return $this; |
809
|
|
|
} |
810
|
|
|
|
811
|
|
|
/** |
812
|
|
|
* @return string |
813
|
|
|
*/ |
814
|
|
|
public function getSenderName(): string |
815
|
|
|
{ |
816
|
|
|
return $this->senderName; |
817
|
|
|
} |
818
|
|
|
|
819
|
|
|
/** |
820
|
|
|
* @param string $senderName |
821
|
|
|
* |
822
|
|
|
* @return Label |
823
|
|
|
*/ |
824
|
|
|
public function setSenderName(string $senderName) : Label |
825
|
|
|
{ |
826
|
|
|
$this->senderName = $senderName; |
827
|
|
|
|
828
|
|
|
return $this; |
829
|
|
|
} |
830
|
|
|
|
831
|
|
|
/** |
832
|
|
|
* @return string |
833
|
|
|
*/ |
834
|
|
|
public function getSenderAddress1(): string |
835
|
|
|
{ |
836
|
|
|
return $this->senderAddress1; |
837
|
|
|
} |
838
|
|
|
|
839
|
|
|
/** |
840
|
|
|
* @param string $senderAddress1 |
841
|
|
|
* |
842
|
|
|
* @return Label |
843
|
|
|
*/ |
844
|
|
|
public function setSenderAddress1(string $senderAddress1) : Label |
845
|
|
|
{ |
846
|
|
|
$this->senderAddress1 = $senderAddress1; |
847
|
|
|
|
848
|
|
|
return $this; |
849
|
|
|
} |
850
|
|
|
|
851
|
|
|
/** |
852
|
|
|
* @return string |
853
|
|
|
*/ |
854
|
|
|
public function getSenderAddress2(): ?string |
855
|
|
|
{ |
856
|
|
|
return $this->senderAddress2; |
857
|
|
|
} |
858
|
|
|
|
859
|
|
|
/** |
860
|
|
|
* @param string $senderAddress2 |
861
|
|
|
* |
862
|
|
|
* @return Label |
863
|
|
|
*/ |
864
|
|
|
public function setSenderAddress2(string $senderAddress2) : Label |
865
|
|
|
{ |
866
|
|
|
$this->senderAddress2 = $senderAddress2; |
867
|
|
|
|
868
|
|
|
return $this; |
869
|
|
|
} |
870
|
|
|
|
871
|
|
|
/** |
872
|
|
|
* @return string |
873
|
|
|
*/ |
874
|
|
|
public function getSenderCountryCode(): string |
875
|
|
|
{ |
876
|
|
|
return $this->senderCountryCode; |
877
|
|
|
} |
878
|
|
|
|
879
|
|
|
/** |
880
|
|
|
* @param string $senderCountryCode |
881
|
|
|
* |
882
|
|
|
* @return Label |
883
|
|
|
*/ |
884
|
|
|
public function setSenderCountryCode(string $senderCountryCode) : Label |
885
|
|
|
{ |
886
|
|
|
$this->senderCountryCode = $senderCountryCode; |
887
|
|
|
|
888
|
|
|
return $this; |
889
|
|
|
} |
890
|
|
|
|
891
|
|
|
/** |
892
|
|
|
* @return string |
893
|
|
|
*/ |
894
|
|
|
public function getSenderZipCode(): string |
895
|
|
|
{ |
896
|
|
|
return $this->senderZipCode; |
897
|
|
|
} |
898
|
|
|
|
899
|
|
|
/** |
900
|
|
|
* @param string $senderZipCode |
901
|
|
|
* |
902
|
|
|
* @return Label |
903
|
|
|
*/ |
904
|
|
|
public function setSenderZipCode(string $senderZipCode) : Label |
905
|
|
|
{ |
906
|
|
|
$this->senderZipCode = $senderZipCode; |
907
|
|
|
|
908
|
|
|
return $this; |
909
|
|
|
} |
910
|
|
|
|
911
|
|
|
/** |
912
|
|
|
* @return string |
913
|
|
|
*/ |
914
|
|
|
public function getSenderCity(): string |
915
|
|
|
{ |
916
|
|
|
return $this->senderCity; |
917
|
|
|
} |
918
|
|
|
|
919
|
|
|
/** |
920
|
|
|
* @param string $senderCity |
921
|
|
|
* |
922
|
|
|
* @return Label |
923
|
|
|
*/ |
924
|
|
|
public function setSenderCity(string $senderCity) : Label |
925
|
|
|
{ |
926
|
|
|
$this->senderCity = $senderCity; |
927
|
|
|
|
928
|
|
|
return $this; |
929
|
|
|
} |
930
|
|
|
|
931
|
|
|
/** |
932
|
|
|
* @return string |
933
|
|
|
*/ |
934
|
|
|
public function getSenderAttention(): ?string |
935
|
|
|
{ |
936
|
|
|
return $this->senderAttention; |
937
|
|
|
} |
938
|
|
|
|
939
|
|
|
/** |
940
|
|
|
* @param string $senderAttention |
941
|
|
|
* |
942
|
|
|
* @return Label |
943
|
|
|
*/ |
944
|
|
|
public function setSenderAttention(string $senderAttention) : Label |
945
|
|
|
{ |
946
|
|
|
$this->senderAttention = $senderAttention; |
947
|
|
|
|
948
|
|
|
return $this; |
949
|
|
|
} |
950
|
|
|
|
951
|
|
|
/** |
952
|
|
|
* @return string |
953
|
|
|
*/ |
954
|
|
|
public function getSenderEmail(): string |
955
|
|
|
{ |
956
|
|
|
return $this->senderEmail; |
957
|
|
|
} |
958
|
|
|
|
959
|
|
|
/** |
960
|
|
|
* @param string $senderEmail |
961
|
|
|
* |
962
|
|
|
* @return Label |
963
|
|
|
*/ |
964
|
|
|
public function setSenderEmail(string $senderEmail) : Label |
965
|
|
|
{ |
966
|
|
|
$this->senderEmail = $senderEmail; |
967
|
|
|
|
968
|
|
|
return $this; |
969
|
|
|
} |
970
|
|
|
|
971
|
|
|
/** |
972
|
|
|
* @return string |
973
|
|
|
*/ |
974
|
|
|
public function getSenderTelephone(): ?string |
975
|
|
|
{ |
976
|
|
|
return $this->senderTelephone; |
977
|
|
|
} |
978
|
|
|
|
979
|
|
|
/** |
980
|
|
|
* @param string $senderTelephone |
981
|
|
|
* |
982
|
|
|
* @return Label |
983
|
|
|
*/ |
984
|
|
|
public function setSenderTelephone(string $senderTelephone) : Label |
985
|
|
|
{ |
986
|
|
|
$this->senderTelephone = $senderTelephone; |
987
|
|
|
|
988
|
|
|
return $this; |
989
|
|
|
} |
990
|
|
|
|
991
|
|
|
/** |
992
|
|
|
* @return string |
993
|
|
|
*/ |
994
|
|
|
public function getSenderMobile(): ?string |
995
|
|
|
{ |
996
|
|
|
return $this->senderMobile; |
997
|
|
|
} |
998
|
|
|
|
999
|
|
|
/** |
1000
|
|
|
* @param string $senderMobile |
1001
|
|
|
* |
1002
|
|
|
* @return Label |
1003
|
|
|
*/ |
1004
|
|
|
public function setSenderMobile(string $senderMobile) : Label |
1005
|
|
|
{ |
1006
|
|
|
$this->senderMobile = $senderMobile; |
1007
|
|
|
|
1008
|
|
|
return $this; |
1009
|
|
|
} |
1010
|
|
|
|
1011
|
|
|
/** |
1012
|
|
|
* @return string |
1013
|
|
|
*/ |
1014
|
|
|
public function getReceiverName(): string |
1015
|
|
|
{ |
1016
|
|
|
return $this->receiverName; |
1017
|
|
|
} |
1018
|
|
|
|
1019
|
|
|
/** |
1020
|
|
|
* @param string $receiverName |
1021
|
|
|
* |
1022
|
|
|
* @return Label |
1023
|
|
|
*/ |
1024
|
|
|
public function setReceiverName(string $receiverName) : Label |
1025
|
|
|
{ |
1026
|
|
|
$this->receiverName = $receiverName; |
1027
|
|
|
|
1028
|
|
|
return $this; |
1029
|
|
|
} |
1030
|
|
|
|
1031
|
|
|
/** |
1032
|
|
|
* @return string |
1033
|
|
|
*/ |
1034
|
|
|
public function getReceiverAddress1(): string |
1035
|
|
|
{ |
1036
|
|
|
return $this->receiverAddress1; |
1037
|
|
|
} |
1038
|
|
|
|
1039
|
|
|
/** |
1040
|
|
|
* @param string $receiverAddress1 |
1041
|
|
|
* |
1042
|
|
|
* @return Label |
1043
|
|
|
*/ |
1044
|
|
|
public function setReceiverAddress1(string $receiverAddress1) : Label |
1045
|
|
|
{ |
1046
|
|
|
$this->receiverAddress1 = $receiverAddress1; |
1047
|
|
|
|
1048
|
|
|
return $this; |
1049
|
|
|
} |
1050
|
|
|
|
1051
|
|
|
/** |
1052
|
|
|
* @return string |
1053
|
|
|
*/ |
1054
|
|
|
public function getReceiverAddress2(): ?string |
1055
|
|
|
{ |
1056
|
|
|
return $this->receiverAddress2; |
1057
|
|
|
} |
1058
|
|
|
|
1059
|
|
|
/** |
1060
|
|
|
* @param string $receiverAddress2 |
1061
|
|
|
* |
1062
|
|
|
* @return Label |
1063
|
|
|
*/ |
1064
|
|
|
public function setReceiverAddress2(string $receiverAddress2) : Label |
1065
|
|
|
{ |
1066
|
|
|
$this->receiverAddress2 = $receiverAddress2; |
1067
|
|
|
|
1068
|
|
|
return $this; |
1069
|
|
|
} |
1070
|
|
|
|
1071
|
|
|
/** |
1072
|
|
|
* @return string |
1073
|
|
|
*/ |
1074
|
|
|
public function getReceiverCountryCode(): string |
1075
|
|
|
{ |
1076
|
|
|
return $this->receiverCountryCode; |
1077
|
|
|
} |
1078
|
|
|
|
1079
|
|
|
/** |
1080
|
|
|
* @param string $receiverCountryCode |
1081
|
|
|
* |
1082
|
|
|
* @return Label |
1083
|
|
|
*/ |
1084
|
|
|
public function setReceiverCountryCode(string $receiverCountryCode) : Label |
1085
|
|
|
{ |
1086
|
|
|
$this->receiverCountryCode = $receiverCountryCode; |
1087
|
|
|
|
1088
|
|
|
return $this; |
1089
|
|
|
} |
1090
|
|
|
|
1091
|
|
|
/** |
1092
|
|
|
* @return string |
1093
|
|
|
*/ |
1094
|
|
|
public function getReceiverZipCode(): string |
1095
|
|
|
{ |
1096
|
|
|
return $this->receiverZipCode; |
1097
|
|
|
} |
1098
|
|
|
|
1099
|
|
|
/** |
1100
|
|
|
* @param string $receiverZipCode |
1101
|
|
|
* |
1102
|
|
|
* @return Label |
1103
|
|
|
*/ |
1104
|
|
|
public function setReceiverZipCode(string $receiverZipCode) : Label |
1105
|
|
|
{ |
1106
|
|
|
$this->receiverZipCode = $receiverZipCode; |
1107
|
|
|
|
1108
|
|
|
return $this; |
1109
|
|
|
} |
1110
|
|
|
|
1111
|
|
|
/** |
1112
|
|
|
* @return string |
1113
|
|
|
*/ |
1114
|
|
|
public function getReceiverCity(): string |
1115
|
|
|
{ |
1116
|
|
|
return $this->receiverCity; |
1117
|
|
|
} |
1118
|
|
|
|
1119
|
|
|
/** |
1120
|
|
|
* @param string $receiverCity |
1121
|
|
|
* |
1122
|
|
|
* @return Label |
1123
|
|
|
*/ |
1124
|
|
|
public function setReceiverCity(string $receiverCity) : Label |
1125
|
|
|
{ |
1126
|
|
|
$this->receiverCity = $receiverCity; |
1127
|
|
|
|
1128
|
|
|
return $this; |
1129
|
|
|
} |
1130
|
|
|
|
1131
|
|
|
/** |
1132
|
|
|
* @return string |
1133
|
|
|
*/ |
1134
|
|
|
public function getReceiverAttention(): ?string |
1135
|
|
|
{ |
1136
|
|
|
return $this->receiverAttention; |
1137
|
|
|
} |
1138
|
|
|
|
1139
|
|
|
/** |
1140
|
|
|
* @param string $receiverAttention |
1141
|
|
|
* |
1142
|
|
|
* @return Label |
1143
|
|
|
*/ |
1144
|
|
|
public function setReceiverAttention(string $receiverAttention) : Label |
1145
|
|
|
{ |
1146
|
|
|
$this->receiverAttention = $receiverAttention; |
1147
|
|
|
|
1148
|
|
|
return $this; |
1149
|
|
|
} |
1150
|
|
|
|
1151
|
|
|
/** |
1152
|
|
|
* @return string |
1153
|
|
|
*/ |
1154
|
|
|
public function getReceiverEmail(): string |
1155
|
|
|
{ |
1156
|
|
|
return $this->receiverEmail; |
1157
|
|
|
} |
1158
|
|
|
|
1159
|
|
|
/** |
1160
|
|
|
* @param string $receiverEmail |
1161
|
|
|
* |
1162
|
|
|
* @return Label |
1163
|
|
|
*/ |
1164
|
|
|
public function setReceiverEmail(string $receiverEmail) : Label |
1165
|
|
|
{ |
1166
|
|
|
$this->receiverEmail = $receiverEmail; |
1167
|
|
|
|
1168
|
|
|
return $this; |
1169
|
|
|
} |
1170
|
|
|
|
1171
|
|
|
/** |
1172
|
|
|
* @return string |
1173
|
|
|
*/ |
1174
|
|
|
public function getReceiverTelephone(): ?string |
1175
|
|
|
{ |
1176
|
|
|
return $this->receiverTelephone; |
1177
|
|
|
} |
1178
|
|
|
|
1179
|
|
|
/** |
1180
|
|
|
* @param string $receiverTelephone |
1181
|
|
|
* |
1182
|
|
|
* @return Label |
1183
|
|
|
*/ |
1184
|
|
|
public function setReceiverTelephone(string $receiverTelephone) : Label |
1185
|
|
|
{ |
1186
|
|
|
$this->receiverTelephone = $receiverTelephone; |
1187
|
|
|
|
1188
|
|
|
return $this; |
1189
|
|
|
} |
1190
|
|
|
|
1191
|
|
|
/** |
1192
|
|
|
* @return string |
1193
|
|
|
*/ |
1194
|
|
|
public function getReceiverMobile(): ?string |
1195
|
|
|
{ |
1196
|
|
|
return $this->receiverMobile; |
1197
|
|
|
} |
1198
|
|
|
|
1199
|
|
|
/** |
1200
|
|
|
* @param string $receiverMobile |
1201
|
|
|
* |
1202
|
|
|
* @return Label |
1203
|
|
|
*/ |
1204
|
|
|
public function setReceiverMobile(string $receiverMobile) : Label |
1205
|
|
|
{ |
1206
|
|
|
$this->receiverMobile = $receiverMobile; |
1207
|
|
|
|
1208
|
|
|
return $this; |
1209
|
|
|
} |
1210
|
|
|
|
1211
|
|
|
/** |
1212
|
|
|
* @return string |
1213
|
|
|
*/ |
1214
|
|
|
public function getReceiverInstruction(): ?string |
1215
|
|
|
{ |
1216
|
|
|
return $this->receiverInstruction; |
1217
|
|
|
} |
1218
|
|
|
|
1219
|
|
|
/** |
1220
|
|
|
* @param string $receiverInstruction |
1221
|
|
|
* |
1222
|
|
|
* @return Label |
1223
|
|
|
*/ |
1224
|
|
|
public function setReceiverInstruction(string $receiverInstruction) : Label |
1225
|
|
|
{ |
1226
|
|
|
$this->receiverInstruction = $receiverInstruction; |
1227
|
|
|
|
1228
|
|
|
return $this; |
1229
|
|
|
} |
1230
|
|
|
} |
1231
|
|
|
|