1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Mapado\RestClientSdk\Tests\Model\JsonLd; |
4
|
|
|
|
5
|
|
|
use DateTime; |
6
|
|
|
use Mapado\RestClientSdk\Mapping\Annotations as Rest; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class Cart |
10
|
|
|
* @author Julien Deniau <[email protected]> |
11
|
|
|
* |
12
|
|
|
* @Rest\Entity(key="cart") |
13
|
|
|
*/ |
14
|
|
|
class Cart |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* id |
18
|
|
|
* |
19
|
|
|
* @var mixed |
20
|
|
|
* @access private |
21
|
|
|
* |
22
|
|
|
* @Rest\Id |
23
|
|
|
* @Rest\Attribute(name="id", type="string") |
24
|
|
|
*/ |
25
|
|
|
private $id; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* status |
29
|
|
|
* |
30
|
|
|
* @var mixed |
31
|
|
|
* @access private |
32
|
|
|
* |
33
|
|
|
* @Rest\Attribute(name="status", type="string") |
34
|
|
|
*/ |
35
|
|
|
private $status; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* createdAt |
39
|
|
|
* |
40
|
|
|
* @var mixed |
41
|
|
|
* @access private |
42
|
|
|
* |
43
|
|
|
* @Rest\Attribute(name="created_at", type="datetime") |
44
|
|
|
*/ |
45
|
|
|
private $createdAt; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* cartItemList |
49
|
|
|
* |
50
|
|
|
* @var mixed |
51
|
|
|
* @access private |
52
|
|
|
* |
53
|
|
|
* @Rest\OneToMany(name="cart_items", targetEntity="CartItem") |
54
|
|
|
*/ |
55
|
|
|
private $cartItemList = []; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* clientPhoneNumber |
59
|
|
|
* |
60
|
|
|
* @var string |
61
|
|
|
* @access private |
62
|
|
|
* |
63
|
|
|
* @Rest\Attribute(name="clientPhoneNumber", type="phone_number") |
64
|
|
|
*/ |
65
|
|
|
private $clientPhoneNumber; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* order |
69
|
|
|
* |
70
|
|
|
* @var mixed |
71
|
|
|
* @access private |
72
|
|
|
* |
73
|
|
|
* @Rest\ManyToOne(name="order", targetEntity="Order") |
74
|
|
|
*/ |
75
|
|
|
private $order = null; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Getter for id |
79
|
|
|
* |
80
|
|
|
* @return string |
81
|
|
|
*/ |
82
|
|
|
public function getId() |
83
|
|
|
{ |
84
|
|
|
return $this->id; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Setter for id |
89
|
|
|
* |
90
|
|
|
* @param string $id |
91
|
|
|
* @return Cart |
92
|
|
|
*/ |
93
|
|
|
public function setId($id) |
94
|
|
|
{ |
95
|
|
|
$this->id = $id; |
96
|
|
|
|
97
|
|
|
return $this; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Getter for status |
102
|
|
|
* |
103
|
|
|
* @return string |
104
|
|
|
*/ |
105
|
|
|
public function getStatus() |
106
|
|
|
{ |
107
|
|
|
return $this->status; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* Setter for status |
112
|
|
|
* |
113
|
|
|
* @param string $status |
114
|
|
|
* @return Cart |
115
|
|
|
*/ |
116
|
|
|
public function setStatus($status) |
117
|
|
|
{ |
118
|
|
|
$this->status = $status; |
119
|
|
|
|
120
|
|
|
return $this; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Getter for createdAt |
125
|
|
|
* |
126
|
|
|
* @return DateTime |
127
|
|
|
*/ |
128
|
|
|
public function getCreatedAt() |
129
|
|
|
{ |
130
|
|
|
return $this->createdAt; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* Setter for createdAt |
135
|
|
|
* |
136
|
|
|
* @param DateTime $createdAt |
137
|
|
|
* @return Cart |
138
|
|
|
*/ |
139
|
|
|
public function setCreatedAt(DateTime $createdAt) |
140
|
|
|
{ |
141
|
|
|
$this->createdAt = $createdAt; |
142
|
|
|
|
143
|
|
|
return $this; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* Getter for cartItemList |
148
|
|
|
* |
149
|
|
|
* @return array |
150
|
|
|
*/ |
151
|
|
|
public function getCartItemList() |
152
|
|
|
{ |
153
|
|
|
return $this->cartItemList; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* Setter for cartItemList |
158
|
|
|
* |
159
|
|
|
* @param array $cartItemList |
160
|
|
|
* @return Cart |
161
|
|
|
*/ |
162
|
|
|
public function setCartItemList($cartItemList) |
163
|
|
|
{ |
164
|
|
|
$this->cartItemList = $cartItemList; |
165
|
|
|
|
166
|
|
|
return $this; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
public function addCartItemList($cartItem) |
170
|
|
|
{ |
171
|
|
|
$this->cartItemList[] = $cartItem; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* Getter for clientPhoneNumber |
176
|
|
|
* |
177
|
|
|
* @return string |
178
|
|
|
*/ |
179
|
|
|
public function getClientPhoneNumber() |
180
|
|
|
{ |
181
|
|
|
return $this->clientPhoneNumber; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* Setter for clientPhoneNumber |
186
|
|
|
* |
187
|
|
|
* @param string $clientPhoneNumber |
188
|
|
|
* @return Cart |
189
|
|
|
*/ |
190
|
|
|
public function setClientPhoneNumber($clientPhoneNumber) |
191
|
|
|
{ |
192
|
|
|
$this->clientPhoneNumber = $clientPhoneNumber; |
193
|
|
|
|
194
|
|
|
return $this; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* Getter for order |
199
|
|
|
* |
200
|
|
|
* @return string |
201
|
|
|
*/ |
202
|
|
|
public function getOrder() |
203
|
|
|
{ |
204
|
|
|
return $this->order; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* Setter for order |
209
|
|
|
* |
210
|
|
|
* @param string $order |
211
|
|
|
* @return Cart |
212
|
|
|
*/ |
213
|
|
|
public function setOrder($order) |
214
|
|
|
{ |
215
|
|
|
$this->order = $order; |
216
|
|
|
|
217
|
|
|
return $this; |
218
|
|
|
} |
219
|
|
|
} |
220
|
|
|
|