|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Azine\JsCryptoStoreBundle\Entity; |
|
4
|
|
|
|
|
5
|
|
|
class EncryptedFile |
|
6
|
|
|
{ |
|
7
|
|
|
public function setCreatedValue() |
|
8
|
|
|
{ |
|
9
|
|
|
$this->created = new \DateTime(); |
|
10
|
|
|
} |
|
11
|
|
|
|
|
12
|
|
|
//////////////////////////// Generated Code Below This Line //////////////////////////////// |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* @var int |
|
16
|
|
|
*/ |
|
17
|
|
|
private $id; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @var string |
|
21
|
|
|
*/ |
|
22
|
|
|
private $token; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @var \DateTime |
|
26
|
|
|
*/ |
|
27
|
|
|
private $created; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @var \DateTime |
|
31
|
|
|
*/ |
|
32
|
|
|
private $expiry; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* @var string|null |
|
36
|
|
|
*/ |
|
37
|
|
|
private $file; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @var string|null |
|
41
|
|
|
*/ |
|
42
|
|
|
private $description; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @var int|null |
|
46
|
|
|
*/ |
|
47
|
|
|
private $owner_id; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Get id. |
|
51
|
|
|
* |
|
52
|
|
|
* @return int |
|
53
|
|
|
*/ |
|
54
|
|
|
public function getId() |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->id; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* Set token. |
|
61
|
|
|
* |
|
62
|
|
|
* @param string $token |
|
63
|
|
|
* |
|
64
|
|
|
* @return EncryptedFile |
|
65
|
|
|
*/ |
|
66
|
|
|
public function setToken($token) |
|
67
|
|
|
{ |
|
68
|
|
|
$this->token = $token; |
|
69
|
|
|
|
|
70
|
|
|
return $this; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* Get token. |
|
75
|
|
|
* |
|
76
|
|
|
* @return string |
|
77
|
|
|
*/ |
|
78
|
|
|
public function getToken() |
|
79
|
|
|
{ |
|
80
|
|
|
return $this->token; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* Set created. |
|
85
|
|
|
* |
|
86
|
|
|
* @param \DateTime $created |
|
87
|
|
|
* |
|
88
|
|
|
* @return EncryptedFile |
|
89
|
|
|
*/ |
|
90
|
|
|
public function setCreated($created) |
|
91
|
|
|
{ |
|
92
|
|
|
$this->created = $created; |
|
93
|
|
|
|
|
94
|
|
|
return $this; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* Get created. |
|
99
|
|
|
* |
|
100
|
|
|
* @return \DateTime |
|
101
|
|
|
*/ |
|
102
|
|
|
public function getCreated() |
|
103
|
|
|
{ |
|
104
|
|
|
return $this->created; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* Set expiry. |
|
109
|
|
|
* |
|
110
|
|
|
* @param \DateTime $expiry |
|
111
|
|
|
* |
|
112
|
|
|
* @return EncryptedFile |
|
113
|
|
|
*/ |
|
114
|
|
|
public function setExpiry($expiry) |
|
115
|
|
|
{ |
|
116
|
|
|
$this->expiry = $expiry; |
|
117
|
|
|
|
|
118
|
|
|
return $this; |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* Get expiry. |
|
123
|
|
|
* |
|
124
|
|
|
* @return \DateTime |
|
125
|
|
|
*/ |
|
126
|
|
|
public function getExpiry() |
|
127
|
|
|
{ |
|
128
|
|
|
return $this->expiry; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* Set file. |
|
133
|
|
|
* |
|
134
|
|
|
* @param string|null $file |
|
135
|
|
|
* |
|
136
|
|
|
* @return EncryptedFile |
|
137
|
|
|
*/ |
|
138
|
|
|
public function setFile($file = null) |
|
139
|
|
|
{ |
|
140
|
|
|
$this->file = $file; |
|
141
|
|
|
|
|
142
|
|
|
return $this; |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
/** |
|
146
|
|
|
* Get file. |
|
147
|
|
|
* |
|
148
|
|
|
* @return string|null |
|
149
|
|
|
*/ |
|
150
|
|
|
public function getFile() |
|
151
|
|
|
{ |
|
152
|
|
|
return $this->file; |
|
153
|
|
|
} |
|
154
|
|
|
|
|
155
|
|
|
/** |
|
156
|
|
|
* Set description. |
|
157
|
|
|
* |
|
158
|
|
|
* @param string|null $description |
|
159
|
|
|
* |
|
160
|
|
|
* @return EncryptedFile |
|
161
|
|
|
*/ |
|
162
|
|
|
public function setDescription($description = null) |
|
163
|
|
|
{ |
|
164
|
|
|
$this->description = $description; |
|
165
|
|
|
|
|
166
|
|
|
return $this; |
|
167
|
|
|
} |
|
168
|
|
|
|
|
169
|
|
|
/** |
|
170
|
|
|
* Get description. |
|
171
|
|
|
* |
|
172
|
|
|
* @return string|null |
|
173
|
|
|
*/ |
|
174
|
|
|
public function getDescription() |
|
175
|
|
|
{ |
|
176
|
|
|
return $this->description; |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* Set ownerId. |
|
181
|
|
|
* |
|
182
|
|
|
* @param int|null $ownerId |
|
183
|
|
|
* |
|
184
|
|
|
* @return EncryptedFile |
|
185
|
|
|
*/ |
|
186
|
|
|
public function setOwnerId($ownerId = null) |
|
187
|
|
|
{ |
|
188
|
|
|
$this->owner_id = $ownerId; |
|
189
|
|
|
|
|
190
|
|
|
return $this; |
|
191
|
|
|
} |
|
192
|
|
|
|
|
193
|
|
|
/** |
|
194
|
|
|
* Get ownerId. |
|
195
|
|
|
* |
|
196
|
|
|
* @return int|null |
|
197
|
|
|
*/ |
|
198
|
|
|
public function getOwnerId() |
|
199
|
|
|
{ |
|
200
|
|
|
return $this->owner_id; |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
/** |
|
204
|
|
|
* @var string |
|
205
|
|
|
*/ |
|
206
|
|
|
private $salt; |
|
207
|
|
|
|
|
208
|
|
|
/** |
|
209
|
|
|
* Set salt. |
|
210
|
|
|
* |
|
211
|
|
|
* @param string $salt |
|
212
|
|
|
* |
|
213
|
|
|
* @return EncryptedFile |
|
214
|
|
|
*/ |
|
215
|
|
|
public function setSalt($salt) |
|
216
|
|
|
{ |
|
217
|
|
|
$this->salt = $salt; |
|
218
|
|
|
|
|
219
|
|
|
return $this; |
|
220
|
|
|
} |
|
221
|
|
|
|
|
222
|
|
|
/** |
|
223
|
|
|
* Get salt. |
|
224
|
|
|
* |
|
225
|
|
|
* @return string |
|
226
|
|
|
*/ |
|
227
|
|
|
public function getSalt() |
|
228
|
|
|
{ |
|
229
|
|
|
return $this->salt; |
|
230
|
|
|
} |
|
231
|
|
|
|
|
232
|
|
|
/** |
|
233
|
|
|
* @var string |
|
234
|
|
|
*/ |
|
235
|
|
|
private $iv; |
|
236
|
|
|
|
|
237
|
|
|
/** |
|
238
|
|
|
* Set iv. |
|
239
|
|
|
* |
|
240
|
|
|
* @param string $iv |
|
241
|
|
|
* |
|
242
|
|
|
* @return EncryptedFile |
|
243
|
|
|
*/ |
|
244
|
|
|
public function setIv($iv) |
|
245
|
|
|
{ |
|
246
|
|
|
$this->iv = $iv; |
|
247
|
|
|
|
|
248
|
|
|
return $this; |
|
249
|
|
|
} |
|
250
|
|
|
|
|
251
|
|
|
/** |
|
252
|
|
|
* Get iv. |
|
253
|
|
|
* |
|
254
|
|
|
* @return string |
|
255
|
|
|
*/ |
|
256
|
|
|
public function getIv() |
|
257
|
|
|
{ |
|
258
|
|
|
return $this->iv; |
|
259
|
|
|
} |
|
260
|
|
|
|
|
261
|
|
|
/** |
|
262
|
|
|
* @var string |
|
263
|
|
|
*/ |
|
264
|
|
|
private $fileName; |
|
265
|
|
|
|
|
266
|
|
|
/** |
|
267
|
|
|
* @var string |
|
268
|
|
|
*/ |
|
269
|
|
|
private $mimeType; |
|
270
|
|
|
|
|
271
|
|
|
/** |
|
272
|
|
|
* Set fileName. |
|
273
|
|
|
* |
|
274
|
|
|
* @param string $fileName |
|
275
|
|
|
* |
|
276
|
|
|
* @return EncryptedFile |
|
277
|
|
|
*/ |
|
278
|
|
|
public function setFileName($fileName) |
|
279
|
|
|
{ |
|
280
|
|
|
$this->fileName = $fileName; |
|
281
|
|
|
|
|
282
|
|
|
return $this; |
|
283
|
|
|
} |
|
284
|
|
|
|
|
285
|
|
|
/** |
|
286
|
|
|
* Get fileName. |
|
287
|
|
|
* |
|
288
|
|
|
* @return string |
|
289
|
|
|
*/ |
|
290
|
|
|
public function getFileName() |
|
291
|
|
|
{ |
|
292
|
|
|
return $this->fileName; |
|
293
|
|
|
} |
|
294
|
|
|
|
|
295
|
|
|
/** |
|
296
|
|
|
* Set mimeType. |
|
297
|
|
|
* |
|
298
|
|
|
* @param string $mimeType |
|
299
|
|
|
* |
|
300
|
|
|
* @return EncryptedFile |
|
301
|
|
|
*/ |
|
302
|
|
|
public function setMimeType($mimeType) |
|
303
|
|
|
{ |
|
304
|
|
|
$this->mimeType = $mimeType; |
|
305
|
|
|
|
|
306
|
|
|
return $this; |
|
307
|
|
|
} |
|
308
|
|
|
|
|
309
|
|
|
/** |
|
310
|
|
|
* Get mimeType. |
|
311
|
|
|
* |
|
312
|
|
|
* @return string |
|
313
|
|
|
*/ |
|
314
|
|
|
public function getMimeType() |
|
315
|
|
|
{ |
|
316
|
|
|
return $this->mimeType; |
|
317
|
|
|
} |
|
318
|
|
|
|
|
319
|
|
|
/** |
|
320
|
|
|
* @var string |
|
321
|
|
|
*/ |
|
322
|
|
|
private $groupToken; |
|
323
|
|
|
|
|
324
|
|
|
/** |
|
325
|
|
|
* Set groupToken. |
|
326
|
|
|
* |
|
327
|
|
|
* @param string $groupToken |
|
328
|
|
|
* |
|
329
|
|
|
* @return EncryptedFile |
|
330
|
|
|
*/ |
|
331
|
|
|
public function setGroupToken($groupToken) |
|
332
|
|
|
{ |
|
333
|
|
|
$this->groupToken = $groupToken; |
|
334
|
|
|
|
|
335
|
|
|
return $this; |
|
336
|
|
|
} |
|
337
|
|
|
|
|
338
|
|
|
/** |
|
339
|
|
|
* Get groupToken. |
|
340
|
|
|
* |
|
341
|
|
|
* @return string |
|
342
|
|
|
*/ |
|
343
|
|
|
public function getGroupToken() |
|
344
|
|
|
{ |
|
345
|
|
|
return $this->groupToken; |
|
346
|
|
|
} |
|
347
|
|
|
} |
|
348
|
|
|
|