1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of RussianPost SDK package. |
5
|
|
|
* |
6
|
|
|
* © Appwilio (http://appwilio.com), greabock (https://github.com/greabock), JhaoDa (https://github.com/jhaoda) |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
declare(strict_types=1); |
13
|
|
|
|
14
|
|
|
namespace Appwilio\RussianPostSDK\Dispatching\Entities; |
15
|
|
|
|
16
|
|
|
trait CommonOrder |
17
|
|
|
{ |
18
|
1 |
|
public function dimensions(int $height, int $width, int $length) |
19
|
|
|
{ |
20
|
1 |
|
$this->data['dimension'] = \compact('height', 'width', 'length'); |
|
|
|
|
21
|
|
|
|
22
|
1 |
|
return $this; |
23
|
|
|
} |
24
|
|
|
|
25
|
1 |
|
public function fragile(bool $value = true) |
26
|
|
|
{ |
27
|
1 |
|
$this->data['fragile'] = $value; |
|
|
|
|
28
|
|
|
|
29
|
1 |
|
return $this; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function transport(string $value) |
33
|
|
|
{ |
34
|
|
|
$this->data['transport-type'] = $value; |
|
|
|
|
35
|
|
|
|
36
|
|
|
return $this; |
37
|
|
|
} |
38
|
|
|
|
39
|
1 |
|
public function withCompletenessChecking(bool $value = true) |
40
|
|
|
{ |
41
|
1 |
|
$this->data['completeness-checking'] = $value; |
|
|
|
|
42
|
|
|
|
43
|
1 |
|
return $this; |
44
|
|
|
} |
45
|
|
|
|
46
|
1 |
|
public function withElectronicNotice(bool $value = true) |
47
|
|
|
{ |
48
|
1 |
|
$this->data['with-electronic-notice'] = $value; |
|
|
|
|
49
|
|
|
|
50
|
1 |
|
return $this; |
51
|
|
|
} |
52
|
|
|
|
53
|
1 |
|
public function withInventory(bool $value = true) |
54
|
|
|
{ |
55
|
1 |
|
$this->data['inventory'] = $value; |
|
|
|
|
56
|
|
|
|
57
|
1 |
|
return $this; |
58
|
|
|
} |
59
|
|
|
|
60
|
1 |
|
public function withRegisteredNotice(bool $value = true) |
61
|
|
|
{ |
62
|
1 |
|
$this->data['with-order-of-notice'] = $value; |
|
|
|
|
63
|
|
|
|
64
|
1 |
|
return $this; |
65
|
|
|
} |
66
|
|
|
|
67
|
1 |
|
public function withSimpleNotice(bool $value = true) |
68
|
|
|
{ |
69
|
1 |
|
$this->data['with-simple-notice'] = $value; |
|
|
|
|
70
|
|
|
|
71
|
1 |
|
return $this; |
72
|
|
|
} |
73
|
|
|
|
74
|
1 |
|
public function withSmsNotice(bool $value = true) |
75
|
|
|
{ |
76
|
1 |
|
$this->data['sms-notice-recipient'] = $value; |
|
|
|
|
77
|
|
|
|
78
|
1 |
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
public function withVsd(bool $value = true) |
82
|
|
|
{ |
83
|
|
|
$this->data['vsd'] = $value; |
|
|
|
|
84
|
|
|
|
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
1 |
|
public function viaCourier(bool $value = true) |
89
|
|
|
{ |
90
|
1 |
|
$this->data['courier'] = $value; |
|
|
|
|
91
|
|
|
|
92
|
1 |
|
return $this; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
|