1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @author Rafał Muszyński <[email protected]> |
5
|
|
|
* @copyright 2015 Sourcefabric z.ú. |
6
|
|
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt |
7
|
|
|
*/ |
8
|
|
|
namespace Newscoop\PaywallBundle\Entity; |
9
|
|
|
|
10
|
|
|
use Doctrine\ORM\Mapping as ORM; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Modification entity. |
14
|
|
|
* |
15
|
|
|
* @ORM\Entity() |
16
|
|
|
* @ORM\Table(name="plugin_paywall_modification") |
17
|
|
|
*/ |
18
|
|
|
class Modification |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @ORM\Id |
22
|
|
|
* @ORM\GeneratedValue |
23
|
|
|
* @ORM\Column(type="integer", name="id") |
24
|
|
|
* |
25
|
|
|
* @var int |
26
|
|
|
*/ |
27
|
|
|
protected $id; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @ORM\ManyToOne(targetEntity="Order", inversedBy="modifications") |
31
|
|
|
* @ORM\JoinColumn(name="order_id", referencedColumnName="id", nullable=true) |
32
|
|
|
* |
33
|
|
|
* @var Order |
34
|
|
|
*/ |
35
|
|
|
protected $order; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @ORM\ManyToOne(targetEntity="UserSubscription", inversedBy="modifications") |
39
|
|
|
* @ORM\JoinColumn(name="order_item_id", referencedColumnName="Id", nullable=true) |
40
|
|
|
* |
41
|
|
|
* @var UserSubscription |
42
|
|
|
*/ |
43
|
|
|
protected $orderItem; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @ORM\Column(type="string", name="label") |
47
|
|
|
* |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
protected $label; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @ORM\Column(type="string", name="modification_origin_id") |
54
|
|
|
* |
55
|
|
|
* @var string |
56
|
|
|
*/ |
57
|
|
|
protected $modificationOriginId; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @ORM\Column(type="string", name="modification_type") |
61
|
|
|
* |
62
|
|
|
* @var string |
63
|
|
|
*/ |
64
|
|
|
protected $modificationType; |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @ORM\Column(type="string", name="description", nullable=true) |
68
|
|
|
* |
69
|
|
|
* @var string |
70
|
|
|
*/ |
71
|
|
|
protected $description; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @ORM\Column(type="integer", name="amount") |
75
|
|
|
* |
76
|
|
|
* @var int |
77
|
|
|
*/ |
78
|
|
|
protected $amount = 0; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @ORM\Column(type="datetime", name="updated_at", nullable=true) |
82
|
|
|
* |
83
|
|
|
* @var \DateTime |
84
|
|
|
*/ |
85
|
|
|
protected $updatedAt; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @ORM\Column(type="datetime", name="created_at") |
89
|
|
|
* |
90
|
|
|
* @var \DateTime |
91
|
|
|
*/ |
92
|
|
|
protected $createdAt; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Constructor. |
96
|
|
|
*/ |
97
|
|
|
public function __construct() |
98
|
|
|
{ |
99
|
|
|
$this->createdAt = new \DateTime(); |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* Gets the value of createdAt. |
104
|
|
|
* |
105
|
|
|
* @return \DateTime |
106
|
|
|
*/ |
107
|
|
|
public function getCreatedAt() |
108
|
|
|
{ |
109
|
|
|
return $this->createdAt; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* Sets the value of createdAt. |
114
|
|
|
* |
115
|
|
|
* @param \DateTime $createdAt the created at |
116
|
|
|
* |
117
|
|
|
* @return self |
118
|
|
|
*/ |
119
|
|
|
protected function setCreatedAt(\DateTime $createdAt) |
120
|
|
|
{ |
121
|
|
|
$this->createdAt = $createdAt; |
122
|
|
|
|
123
|
|
|
return $this; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* Gets the value of id. |
128
|
|
|
* |
129
|
|
|
* @return int |
130
|
|
|
*/ |
131
|
|
|
public function getId() |
132
|
|
|
{ |
133
|
|
|
return $this->id; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Sets the value of id. |
138
|
|
|
* |
139
|
|
|
* @param int $id the id |
140
|
|
|
* |
141
|
|
|
* @return self |
142
|
|
|
*/ |
143
|
|
|
public function setId($id) |
144
|
|
|
{ |
145
|
|
|
$this->id = $id; |
146
|
|
|
|
147
|
|
|
return $this; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* Gets the value of order. |
152
|
|
|
* |
153
|
|
|
* @return Order |
154
|
|
|
*/ |
155
|
|
|
public function getOrder() |
156
|
|
|
{ |
157
|
|
|
return $this->order; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Sets the value of order. |
162
|
|
|
* |
163
|
|
|
* @param Order $order the order |
164
|
|
|
* |
165
|
|
|
* @return self |
166
|
|
|
*/ |
167
|
|
|
public function setOrder(Order $order) |
168
|
|
|
{ |
169
|
|
|
$this->order = $order; |
170
|
|
|
|
171
|
|
|
return $this; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* Gets the value of orderItem. |
176
|
|
|
* |
177
|
|
|
* @return UserSubscription |
178
|
|
|
*/ |
179
|
|
|
public function getOrderItem() |
180
|
|
|
{ |
181
|
|
|
return $this->orderItem; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* Sets the value of orderItem. |
186
|
|
|
* |
187
|
|
|
* @param UserSubscription $orderItem the order item |
188
|
|
|
* |
189
|
|
|
* @return self |
190
|
|
|
*/ |
191
|
|
|
public function setOrderItem(UserSubscription $orderItem) |
192
|
|
|
{ |
193
|
|
|
$this->orderItem = $orderItem; |
194
|
|
|
|
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* Gets the value of label. |
200
|
|
|
* |
201
|
|
|
* @return string |
202
|
|
|
*/ |
203
|
|
|
public function getLabel() |
204
|
|
|
{ |
205
|
|
|
return $this->label; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* Sets the value of label. |
210
|
|
|
* |
211
|
|
|
* @param string $label the label |
212
|
|
|
* |
213
|
|
|
* @return self |
214
|
|
|
*/ |
215
|
|
|
public function setLabel($label) |
216
|
|
|
{ |
217
|
|
|
$this->label = $label; |
218
|
|
|
|
219
|
|
|
return $this; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* Gets the value of description. |
224
|
|
|
* |
225
|
|
|
* @return string |
226
|
|
|
*/ |
227
|
|
|
public function getDescription() |
228
|
|
|
{ |
229
|
|
|
return $this->description; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* Sets the value of description. |
234
|
|
|
* |
235
|
|
|
* @param string $description the description |
236
|
|
|
* |
237
|
|
|
* @return self |
238
|
|
|
*/ |
239
|
|
|
public function setDescription($description) |
240
|
|
|
{ |
241
|
|
|
$this->description = $description; |
242
|
|
|
|
243
|
|
|
return $this; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* Gets the value of amount. |
248
|
|
|
* |
249
|
|
|
* @return int |
250
|
|
|
*/ |
251
|
|
|
public function getAmount() |
252
|
|
|
{ |
253
|
|
|
return $this->amount; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* Sets the value of amount. |
258
|
|
|
* |
259
|
|
|
* @param int $amount the amount |
260
|
|
|
* |
261
|
|
|
* @return self |
262
|
|
|
*/ |
263
|
|
|
public function setAmount($amount) |
264
|
|
|
{ |
265
|
|
|
$this->amount = $amount; |
266
|
|
|
|
267
|
|
|
return $this; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* Gets the value of updatedAt. |
272
|
|
|
* |
273
|
|
|
* @return \DateTime |
274
|
|
|
*/ |
275
|
|
|
public function getUpdatedAt() |
276
|
|
|
{ |
277
|
|
|
return $this->updatedAt; |
278
|
|
|
} |
279
|
|
|
|
280
|
|
|
/** |
281
|
|
|
* Sets the value of updatedAt. |
282
|
|
|
* |
283
|
|
|
* @param \DateTime $updatedAt the updated at |
284
|
|
|
* |
285
|
|
|
* @return self |
286
|
|
|
*/ |
287
|
|
|
public function setUpdatedAt(\DateTime $updatedAt) |
288
|
|
|
{ |
289
|
|
|
$this->updatedAt = $updatedAt; |
290
|
|
|
|
291
|
|
|
return $this; |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
/** |
295
|
|
|
* Gets the value of modificationType. |
296
|
|
|
* |
297
|
|
|
* @return string |
298
|
|
|
*/ |
299
|
|
|
public function getModificationType() |
300
|
|
|
{ |
301
|
|
|
return $this->modificationType; |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* Sets the value of modificationType. |
306
|
|
|
* |
307
|
|
|
* @param string $modificationType the modification type |
308
|
|
|
* |
309
|
|
|
* @return self |
310
|
|
|
*/ |
311
|
|
|
public function setModificationType($modificationType) |
312
|
|
|
{ |
313
|
|
|
$this->modificationType = $modificationType; |
314
|
|
|
|
315
|
|
|
return $this; |
316
|
|
|
} |
317
|
|
|
|
318
|
|
|
/** |
319
|
|
|
* Gets the value of modificationOriginId. |
320
|
|
|
* |
321
|
|
|
* @return string |
322
|
|
|
*/ |
323
|
|
|
public function getModificationOriginId() |
324
|
|
|
{ |
325
|
|
|
return $this->modificationOriginId; |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* Sets the value of modificationOriginId. |
330
|
|
|
* |
331
|
|
|
* @param string $modificationOriginId the modification origin id |
332
|
|
|
* |
333
|
|
|
* @return self |
334
|
|
|
*/ |
335
|
|
|
public function setModificationOriginId($modificationOriginId) |
336
|
|
|
{ |
337
|
|
|
$this->modificationOriginId = $modificationOriginId; |
338
|
|
|
|
339
|
|
|
return $this; |
340
|
|
|
} |
341
|
|
|
} |
342
|
|
|
|