|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace PimpayBundle\Model; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class Order |
|
7
|
|
|
* @package PimpayBundle\Model |
|
8
|
|
|
*/ |
|
9
|
|
|
class Order |
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* @var string |
|
13
|
|
|
*/ |
|
14
|
|
|
const MONEY_RECIPIENT_DELIVERY_SERVICE = 'delivery_service'; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @var string |
|
18
|
|
|
*/ |
|
19
|
|
|
const MONEY_RECIPIENT_CLIENT = 'client'; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @var string |
|
23
|
|
|
*/ |
|
24
|
|
|
const MONEY_RECIPIENT_PIMPAY = 'pimpay'; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var string |
|
28
|
|
|
*/ |
|
29
|
|
|
private $id; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var string |
|
33
|
|
|
*/ |
|
34
|
|
|
private $tin; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var string|null |
|
38
|
|
|
*/ |
|
39
|
|
|
private $shopExternalId; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @var OrderBase |
|
43
|
|
|
*/ |
|
44
|
|
|
private $base; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @var string |
|
48
|
|
|
*/ |
|
49
|
|
|
private $createdAt; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var OrderItem[] |
|
53
|
|
|
*/ |
|
54
|
|
|
private $items; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @var Address |
|
58
|
|
|
*/ |
|
59
|
|
|
private $destinationAddress; |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @var Recipient |
|
63
|
|
|
*/ |
|
64
|
|
|
private $recipient; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @var F103 |
|
68
|
|
|
*/ |
|
69
|
|
|
private $f103; |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @var string |
|
73
|
|
|
*/ |
|
74
|
|
|
private $moneyRecipient; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @return string |
|
78
|
|
|
*/ |
|
79
|
|
|
public function getId(): string |
|
80
|
|
|
{ |
|
81
|
|
|
return $this->id; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @param string $id |
|
86
|
|
|
* @return $this |
|
87
|
|
|
*/ |
|
88
|
|
|
public function setId(string $id) |
|
89
|
|
|
{ |
|
90
|
|
|
$this->id = $id; |
|
91
|
|
|
|
|
92
|
|
|
return $this; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @return string |
|
97
|
|
|
*/ |
|
98
|
|
|
public function getTin(): string |
|
99
|
|
|
{ |
|
100
|
|
|
return $this->tin; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param string $tin |
|
105
|
|
|
* @return $this |
|
106
|
|
|
*/ |
|
107
|
|
|
public function setTin(string $tin) |
|
108
|
|
|
{ |
|
109
|
|
|
$this->tin = $tin; |
|
110
|
|
|
|
|
111
|
|
|
return $this; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @return string|null |
|
116
|
|
|
*/ |
|
117
|
|
|
public function getShopExternalId() |
|
118
|
|
|
{ |
|
119
|
|
|
return $this->shopExternalId; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @param string|null $shopExternalId |
|
124
|
|
|
* @return $this |
|
125
|
|
|
*/ |
|
126
|
|
|
public function setShopExternalId(string $shopExternalId = null) |
|
127
|
|
|
{ |
|
128
|
|
|
$this->shopExternalId = $shopExternalId; |
|
129
|
|
|
|
|
130
|
|
|
return $this; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
/** |
|
134
|
|
|
* @return OrderBase |
|
135
|
|
|
*/ |
|
136
|
|
|
public function getBase(): OrderBase |
|
137
|
|
|
{ |
|
138
|
|
|
return $this->base; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* @param OrderBase $base |
|
143
|
|
|
* @return $this |
|
144
|
|
|
*/ |
|
145
|
|
|
public function setBase(OrderBase $base) |
|
146
|
|
|
{ |
|
147
|
|
|
$this->base = $base; |
|
148
|
|
|
|
|
149
|
|
|
return $this; |
|
150
|
|
|
} |
|
151
|
|
|
|
|
152
|
|
|
/** |
|
153
|
|
|
* @return string |
|
154
|
|
|
*/ |
|
155
|
|
|
public function getCreatedAt(): string |
|
156
|
|
|
{ |
|
157
|
|
|
return $this->createdAt; |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* @param \DateTime $createdAt |
|
162
|
|
|
* @return $this |
|
163
|
|
|
*/ |
|
164
|
|
|
public function setCreatedAt(\DateTime $createdAt) |
|
165
|
|
|
{ |
|
166
|
|
|
$this->createdAt = $createdAt->format('Y-m-d H:i:s'); |
|
167
|
|
|
|
|
168
|
|
|
return $this; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* @return OrderItem[] |
|
173
|
|
|
*/ |
|
174
|
|
|
public function getItems(): array |
|
175
|
|
|
{ |
|
176
|
|
|
return $this->items; |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* @param OrderItem $item |
|
181
|
|
|
* @return $this |
|
182
|
|
|
*/ |
|
183
|
|
|
public function addItem(OrderItem $item) |
|
184
|
|
|
{ |
|
185
|
|
|
$this->items[] = $item; |
|
186
|
|
|
|
|
187
|
|
|
return $this; |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
/** |
|
191
|
|
|
* @param OrderItem[] $items |
|
192
|
|
|
* @return $this |
|
193
|
|
|
*/ |
|
194
|
|
|
public function setItems(array $items) |
|
195
|
|
|
{ |
|
196
|
|
|
$this->items = $items; |
|
197
|
|
|
|
|
198
|
|
|
return $this; |
|
199
|
|
|
} |
|
200
|
|
|
|
|
201
|
|
|
/** |
|
202
|
|
|
* @return Address |
|
203
|
|
|
*/ |
|
204
|
|
|
public function getDestinationAddress(): Address |
|
205
|
|
|
{ |
|
206
|
|
|
return $this->destinationAddress; |
|
207
|
|
|
} |
|
208
|
|
|
|
|
209
|
|
|
/** |
|
210
|
|
|
* @param Address $destinationAddress |
|
211
|
|
|
* @return $this |
|
212
|
|
|
*/ |
|
213
|
|
|
public function setDestinationAddress(Address $destinationAddress) |
|
214
|
|
|
{ |
|
215
|
|
|
$this->destinationAddress = $destinationAddress; |
|
216
|
|
|
|
|
217
|
|
|
return $this; |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* @return Recipient |
|
222
|
|
|
*/ |
|
223
|
|
|
public function getRecipient(): Recipient |
|
224
|
|
|
{ |
|
225
|
|
|
return $this->recipient; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* @param Recipient $recipient |
|
230
|
|
|
* @return $this |
|
231
|
|
|
*/ |
|
232
|
|
|
public function setRecipient(Recipient $recipient) |
|
233
|
|
|
{ |
|
234
|
|
|
$this->recipient = $recipient; |
|
235
|
|
|
|
|
236
|
|
|
return $this; |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
/** |
|
240
|
|
|
* @return F103 |
|
241
|
|
|
*/ |
|
242
|
|
|
public function getF103(): F103 |
|
243
|
|
|
{ |
|
244
|
|
|
return $this->f103; |
|
245
|
|
|
} |
|
246
|
|
|
|
|
247
|
|
|
/** |
|
248
|
|
|
* @param F103 $f103 |
|
249
|
|
|
* @return $this |
|
250
|
|
|
*/ |
|
251
|
|
|
public function setF103(F103 $f103) |
|
252
|
|
|
{ |
|
253
|
|
|
$this->f103 = $f103; |
|
254
|
|
|
|
|
255
|
|
|
return $this; |
|
256
|
|
|
} |
|
257
|
|
|
|
|
258
|
|
|
/** |
|
259
|
|
|
* @return string |
|
260
|
|
|
*/ |
|
261
|
|
|
public function getMoneyRecipient(): string |
|
262
|
|
|
{ |
|
263
|
|
|
return $this->moneyRecipient; |
|
264
|
|
|
} |
|
265
|
|
|
|
|
266
|
|
|
/** |
|
267
|
|
|
* @param string $moneyRecipient |
|
268
|
|
|
* @return $this |
|
269
|
|
|
*/ |
|
270
|
|
|
public function setMoneyRecipient(string $moneyRecipient) |
|
271
|
|
|
{ |
|
272
|
|
|
$this->moneyRecipient = $moneyRecipient; |
|
273
|
|
|
|
|
274
|
|
|
return $this; |
|
275
|
|
|
} |
|
276
|
|
|
} |
|
277
|
|
|
|