1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace OceanApplications\Postmen\Models; |
4
|
|
|
|
5
|
|
|
class Customs extends Model |
6
|
|
|
{ |
7
|
|
|
public $purpose; |
8
|
|
|
public $terms_of_trade; |
9
|
|
|
public $eei; |
10
|
|
|
public $billing; |
11
|
|
|
public $importer_address; |
12
|
|
|
public $passport; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @param $value |
16
|
|
|
* |
17
|
|
|
* @throws \Exception |
18
|
|
|
* |
19
|
|
|
* @return $this |
20
|
|
|
*/ |
21
|
|
|
public function purpose($value) |
22
|
|
|
{ |
23
|
|
|
$purposes = ['gift', 'merchandise', 'sample', 'return', 'repair']; |
24
|
|
|
if (in_array($value, $purposes)) { |
25
|
|
|
$this->purpose = $value; |
26
|
|
|
} else { |
27
|
|
|
$error = 'Purpose must be gift, merchandise, sample, return, or repair'; |
28
|
|
|
throw new \Exception($error); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
return $this; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @param $value |
36
|
|
|
* |
37
|
|
|
* @throws \Exception |
38
|
|
|
* |
39
|
|
|
* @return $this |
40
|
|
|
*/ |
41
|
|
|
public function terms_of_trade($value) |
42
|
|
|
{ |
43
|
|
|
$terms = ['dat', 'ddu', 'ddp', 'dap']; |
44
|
|
|
if (in_array($value, $terms)) { |
45
|
|
|
$this->terms_of_trade = $value; |
46
|
|
|
} else { |
47
|
|
|
$error = 'Terms must be dat, ddu, ddp, or dap'; |
48
|
|
|
throw new \Exception($error); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
return $this; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @param no_eei $value |
56
|
|
|
* |
57
|
|
|
* @return $this |
58
|
|
|
*/ |
59
|
|
|
public function no_eei(no_eei $value) |
60
|
|
|
{ |
61
|
|
|
$this->eei = $value; |
62
|
|
|
|
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @param aes $value |
68
|
|
|
* |
69
|
|
|
* @return $this |
70
|
|
|
*/ |
71
|
|
|
public function aes(aes $value) |
72
|
|
|
{ |
73
|
|
|
$this->eei = $value; |
74
|
|
|
|
75
|
|
|
return $this; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param CustomsBilling $value |
80
|
|
|
* |
81
|
|
|
* @return $this |
82
|
|
|
*/ |
83
|
|
|
public function customs_billing(CustomsBilling $value) |
84
|
|
|
{ |
85
|
|
|
$this->billing = $value; |
86
|
|
|
|
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @param Address $value |
92
|
|
|
* |
93
|
|
|
* @return $this |
94
|
|
|
*/ |
95
|
|
|
public function importer_address(Address $value) |
96
|
|
|
{ |
97
|
|
|
$this->importer_address = $value; |
98
|
|
|
|
99
|
|
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param Passport $value |
104
|
|
|
* |
105
|
|
|
* @return $this |
106
|
|
|
*/ |
107
|
|
|
public function passport(Passport $value) |
108
|
|
|
{ |
109
|
|
|
$this->passport = $value; |
110
|
|
|
|
111
|
|
|
return $this; |
112
|
|
|
} |
113
|
|
|
} |
114
|
|
|
|