|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace GGGGino\SkuskuCartBundle\Model; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
6
|
|
|
use Doctrine\Common\Collections\Criteria; |
|
7
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* SkuskuOrder |
|
11
|
|
|
* |
|
12
|
|
|
* @ORM\Table(name="skusku_order") |
|
13
|
|
|
* @ORM\Entity(repositoryClass="GGGGino\SkuskuCartBundle\Repository\OrderRepository") |
|
14
|
|
|
*/ |
|
15
|
|
|
class SkuskuOrder |
|
16
|
|
|
{ |
|
17
|
|
|
const STATUS_PAYED = 0; |
|
18
|
|
|
const STATUS_NOT_PAYED = 1; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @var int |
|
22
|
|
|
* |
|
23
|
|
|
* @ORM\Column(name="id", type="integer") |
|
24
|
|
|
* @ORM\Id |
|
25
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
26
|
|
|
*/ |
|
27
|
|
|
private $id; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @ORM\OneToOne(targetEntity="SkuskuCart", inversedBy="order") |
|
31
|
|
|
* @ORM\JoinColumn(name="cart_id", referencedColumnName="id") |
|
32
|
|
|
*/ |
|
33
|
|
|
private $cart; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @ORM\ManyToOne(targetEntity="SkuskuLangInterface") |
|
37
|
|
|
* @ORM\JoinColumn(name="lang_id", referencedColumnName="id") |
|
38
|
|
|
* @var SkuskuLangInterface |
|
39
|
|
|
*/ |
|
40
|
|
|
protected $lang; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @ORM\ManyToOne(targetEntity="SkuskuCurrencyInterface") |
|
44
|
|
|
* @ORM\JoinColumn(name="currency_id", referencedColumnName="id") |
|
45
|
|
|
* @var SkuskuCurrencyInterface |
|
46
|
|
|
*/ |
|
47
|
|
|
protected $currency; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @ORM\ManyToOne(targetEntity="SkuskuCustomerInterface") |
|
51
|
|
|
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id") |
|
52
|
|
|
* @var SkuskuCustomerInterface |
|
53
|
|
|
*/ |
|
54
|
|
|
protected $customer; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @var \DateTime |
|
58
|
|
|
* |
|
59
|
|
|
* @ORM\Column(name="date_add", type="datetime") |
|
60
|
|
|
*/ |
|
61
|
|
|
private $dateAdd; |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @var \DateTime |
|
65
|
|
|
* |
|
66
|
|
|
* @ORM\Column(name="date_upd", type="datetime") |
|
67
|
|
|
*/ |
|
68
|
|
|
private $dateUpd; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @var string |
|
72
|
|
|
* |
|
73
|
|
|
* @ORM\Column(name="total_paid", type="decimal", precision=10, scale=2) |
|
74
|
|
|
*/ |
|
75
|
|
|
protected $totalPaid; |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @var string |
|
79
|
|
|
* |
|
80
|
|
|
* @ORM\Column(name="total_paid_real", type="decimal", precision=10, scale=2) |
|
81
|
|
|
*/ |
|
82
|
|
|
protected $totalPaidReal; |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @var string |
|
86
|
|
|
* |
|
87
|
|
|
* @ORM\Column(name="total_products", type="decimal", precision=10, scale=2) |
|
88
|
|
|
*/ |
|
89
|
|
|
protected $totalProducts; |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* @var int |
|
93
|
|
|
* |
|
94
|
|
|
* @ORM\Column(name="status", type="integer") |
|
95
|
|
|
*/ |
|
96
|
|
|
private $status = self::STATUS_PAYED; |
|
97
|
|
|
|
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* Cart constructor. |
|
101
|
|
|
*/ |
|
102
|
|
|
public function __construct() |
|
103
|
|
|
{ |
|
104
|
|
|
$this->dateAdd = new \DateTime(); |
|
105
|
|
|
$this->dateUpd = new \DateTime(); |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* Get id. |
|
110
|
|
|
* |
|
111
|
|
|
* @return int |
|
112
|
|
|
*/ |
|
113
|
|
|
public function getId() |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->id; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
/** |
|
119
|
|
|
* Set dateAdd. |
|
120
|
|
|
* |
|
121
|
|
|
* @param \DateTime $dateAdd |
|
122
|
|
|
* |
|
123
|
|
|
* @return SkuskuOrder |
|
124
|
|
|
*/ |
|
125
|
|
|
public function setDateAdd($dateAdd) |
|
126
|
|
|
{ |
|
127
|
|
|
$this->dateAdd = $dateAdd; |
|
128
|
|
|
|
|
129
|
|
|
return $this; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
/** |
|
133
|
|
|
* Get dateAdd. |
|
134
|
|
|
* |
|
135
|
|
|
* @return \DateTime |
|
136
|
|
|
*/ |
|
137
|
|
|
public function getDateAdd() |
|
138
|
|
|
{ |
|
139
|
|
|
return $this->dateAdd; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* Set dateUpd. |
|
144
|
|
|
* |
|
145
|
|
|
* @param \DateTime $dateUpd |
|
146
|
|
|
* |
|
147
|
|
|
* @return SkuskuOrder |
|
148
|
|
|
*/ |
|
149
|
|
|
public function setDateUpd($dateUpd) |
|
150
|
|
|
{ |
|
151
|
|
|
$this->dateUpd = $dateUpd; |
|
152
|
|
|
|
|
153
|
|
|
return $this; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* Get dateUpd. |
|
158
|
|
|
* |
|
159
|
|
|
* @return \DateTime |
|
160
|
|
|
*/ |
|
161
|
|
|
public function getDateUpd() |
|
162
|
|
|
{ |
|
163
|
|
|
return $this->dateUpd; |
|
164
|
|
|
} |
|
165
|
|
|
|
|
166
|
|
|
/** |
|
167
|
|
|
* @return SkuskuCustomerInterface |
|
168
|
|
|
*/ |
|
169
|
|
|
public function getCustomer() |
|
170
|
|
|
{ |
|
171
|
|
|
return $this->customer; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
/** |
|
175
|
|
|
* @return SkuskuCurrencyInterface |
|
176
|
|
|
*/ |
|
177
|
|
|
public function getCurrency() |
|
178
|
|
|
{ |
|
179
|
|
|
return $this->currency; |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
/** |
|
183
|
|
|
* @param SkuskuCurrencyInterface $currency |
|
184
|
|
|
* @return SkuskuOrder |
|
185
|
|
|
*/ |
|
186
|
|
|
public function setCurrency($currency) |
|
187
|
|
|
{ |
|
188
|
|
|
$this->currency = $currency; |
|
189
|
|
|
return $this; |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
/** |
|
193
|
|
|
* @return SkuskuLangInterface |
|
194
|
|
|
*/ |
|
195
|
|
|
public function getLang() |
|
196
|
|
|
{ |
|
197
|
|
|
return $this->lang; |
|
198
|
|
|
} |
|
199
|
|
|
|
|
200
|
|
|
/** |
|
201
|
|
|
* @param SkuskuLangInterface $lang |
|
202
|
|
|
* @return SkuskuOrder |
|
203
|
|
|
*/ |
|
204
|
|
|
public function setLang($lang) |
|
205
|
|
|
{ |
|
206
|
|
|
$this->lang = $lang; |
|
207
|
|
|
return $this; |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
/** |
|
211
|
|
|
* @param SkuskuCustomerInterface $customer |
|
212
|
|
|
* @return SkuskuOrder |
|
213
|
|
|
*/ |
|
214
|
|
|
public function setCustomer($customer) |
|
215
|
|
|
{ |
|
216
|
|
|
$this->customer = $customer; |
|
217
|
|
|
return $this; |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* @return mixed |
|
222
|
|
|
*/ |
|
223
|
|
|
public function getCart() |
|
224
|
|
|
{ |
|
225
|
|
|
return $this->cart; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* @param mixed $cart |
|
230
|
|
|
* @return SkuskuOrder |
|
231
|
|
|
*/ |
|
232
|
|
|
public function setCart($cart) |
|
233
|
|
|
{ |
|
234
|
|
|
$this->cart = $cart; |
|
235
|
|
|
return $this; |
|
236
|
|
|
} |
|
237
|
|
|
|
|
238
|
|
|
/** |
|
239
|
|
|
* @return string |
|
240
|
|
|
*/ |
|
241
|
|
|
public function getTotalPaid() |
|
242
|
|
|
{ |
|
243
|
|
|
return $this->totalPaid; |
|
244
|
|
|
} |
|
245
|
|
|
|
|
246
|
|
|
/** |
|
247
|
|
|
* @param string $totalPaid |
|
248
|
|
|
* @return SkuskuOrder |
|
249
|
|
|
*/ |
|
250
|
|
|
public function setTotalPaid($totalPaid) |
|
251
|
|
|
{ |
|
252
|
|
|
$this->totalPaid = $totalPaid; |
|
253
|
|
|
return $this; |
|
254
|
|
|
} |
|
255
|
|
|
|
|
256
|
|
|
/** |
|
257
|
|
|
* @return string |
|
258
|
|
|
*/ |
|
259
|
|
|
public function getTotalPaidReal() |
|
260
|
|
|
{ |
|
261
|
|
|
return $this->totalPaidReal; |
|
262
|
|
|
} |
|
263
|
|
|
|
|
264
|
|
|
/** |
|
265
|
|
|
* @param string $totalPaidReal |
|
266
|
|
|
* @return SkuskuOrder |
|
267
|
|
|
*/ |
|
268
|
|
|
public function setTotalPaidReal($totalPaidReal) |
|
269
|
|
|
{ |
|
270
|
|
|
$this->totalPaidReal = $totalPaidReal; |
|
271
|
|
|
return $this; |
|
272
|
|
|
} |
|
273
|
|
|
|
|
274
|
|
|
/** |
|
275
|
|
|
* @return string |
|
276
|
|
|
*/ |
|
277
|
|
|
public function getTotalProducts() |
|
278
|
|
|
{ |
|
279
|
|
|
return $this->totalProducts; |
|
280
|
|
|
} |
|
281
|
|
|
|
|
282
|
|
|
/** |
|
283
|
|
|
* @param string $totalProducts |
|
284
|
|
|
* @return SkuskuOrder |
|
285
|
|
|
*/ |
|
286
|
|
|
public function setTotalProducts($totalProducts) |
|
287
|
|
|
{ |
|
288
|
|
|
$this->totalProducts = $totalProducts; |
|
289
|
|
|
return $this; |
|
290
|
|
|
} |
|
291
|
|
|
|
|
292
|
|
|
/** |
|
293
|
|
|
* @return int |
|
294
|
|
|
*/ |
|
295
|
|
|
public function getStatus() |
|
296
|
|
|
{ |
|
297
|
|
|
return $this->status; |
|
298
|
|
|
} |
|
299
|
|
|
|
|
300
|
|
|
/** |
|
301
|
|
|
* @param int $status |
|
302
|
|
|
* @return SkuskuOrder |
|
303
|
|
|
*/ |
|
304
|
|
|
public function setStatus($status) |
|
305
|
|
|
{ |
|
306
|
|
|
$this->status = $status; |
|
307
|
|
|
return $this; |
|
308
|
|
|
} |
|
309
|
|
|
} |
|
310
|
|
|
|