1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of the Zemit Framework. |
4
|
|
|
* |
5
|
|
|
* (c) Zemit Team <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE.txt |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
declare(strict_types=1); |
12
|
|
|
|
13
|
|
|
namespace Zemit\Models\Abstracts; |
14
|
|
|
|
15
|
|
|
use Phalcon\Db\RawValue; |
16
|
|
|
use Zemit\Filter\Validation; |
17
|
|
|
use Zemit\Models\AbstractModel; |
18
|
|
|
use Zemit\Models\Audit; |
19
|
|
|
use Zemit\Models\User; |
20
|
|
|
use Zemit\Models\Abstracts\Interfaces\AuditDetailAbstractInterface; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class AuditDetailAbstract |
24
|
|
|
* |
25
|
|
|
* This class defines a AuditDetail abstract model that extends the AbstractModel class and implements the AuditDetailAbstractInterface. |
26
|
|
|
* It provides properties and methods for managing AuditDetail data. |
27
|
|
|
* |
28
|
|
|
* @property Audit $auditentity |
29
|
|
|
* @property Audit $AuditEntity |
30
|
|
|
* @method Audit getAuditEntity(?array $params = null) |
31
|
|
|
* |
32
|
|
|
* @property User $createdbyentity |
33
|
|
|
* @property User $CreatedByEntity |
34
|
|
|
* @method User getCreatedByEntity(?array $params = null) |
35
|
|
|
* |
36
|
|
|
* @property User $createdasentity |
37
|
|
|
* @property User $CreatedAsEntity |
38
|
|
|
* @method User getCreatedAsEntity(?array $params = null) |
39
|
|
|
* |
40
|
|
|
* @property User $updatedbyentity |
41
|
|
|
* @property User $UpdatedByEntity |
42
|
|
|
* @method User getUpdatedByEntity(?array $params = null) |
43
|
|
|
* |
44
|
|
|
* @property User $updatedasentity |
45
|
|
|
* @property User $UpdatedAsEntity |
46
|
|
|
* @method User getUpdatedAsEntity(?array $params = null) |
47
|
|
|
* |
48
|
|
|
* @property User $deletedbyentity |
49
|
|
|
* @property User $DeletedByEntity |
50
|
|
|
* @method User getDeletedByEntity(?array $params = null) |
51
|
|
|
* |
52
|
|
|
* @property User $deletedasentity |
53
|
|
|
* @property User $DeletedAsEntity |
54
|
|
|
* @method User getDeletedAsEntity(?array $params = null) |
55
|
|
|
* |
56
|
|
|
* @property User $restoredbyentity |
57
|
|
|
* @property User $RestoredByEntity |
58
|
|
|
* @method User getRestoredByEntity(?array $params = null) |
59
|
|
|
* |
60
|
|
|
* @property User $restoredasentity |
61
|
|
|
* @property User $RestoredAsEntity |
62
|
|
|
* @method User getRestoredAsEntity(?array $params = null) |
63
|
|
|
*/ |
64
|
|
|
abstract class AuditDetailAbstract extends AbstractModel implements AuditDetailAbstractInterface |
65
|
|
|
{ |
66
|
|
|
/** |
67
|
|
|
* Column: id |
68
|
|
|
* Attributes: First | Primary | NotNull | Numeric | Unsigned | AutoIncrement | Type(14) |
69
|
|
|
* @var mixed |
70
|
|
|
*/ |
71
|
|
|
public mixed $id = null; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Column: audit_id |
75
|
|
|
* Attributes: NotNull | Numeric | Unsigned | Type(14) |
76
|
|
|
* @var mixed |
77
|
|
|
*/ |
78
|
|
|
public mixed $auditId = null; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Column: model |
82
|
|
|
* Attributes: NotNull | Size(255) | Type(2) |
83
|
|
|
* @var mixed |
84
|
|
|
*/ |
85
|
|
|
public mixed $model = null; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Column: table |
89
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
90
|
|
|
* @var mixed |
91
|
|
|
*/ |
92
|
|
|
public mixed $table = null; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Column: primary |
96
|
|
|
* Attributes: NotNull | Numeric | Unsigned |
97
|
|
|
* @var mixed |
98
|
|
|
*/ |
99
|
|
|
public mixed $primary = null; |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* Column: event |
103
|
|
|
* Attributes: NotNull | Size('create','update','delete','restore','other') | Type(18) |
104
|
|
|
* @var mixed |
105
|
|
|
*/ |
106
|
|
|
public mixed $event = 'other'; |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* Column: column |
110
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
111
|
|
|
* @var mixed |
112
|
|
|
*/ |
113
|
|
|
public mixed $column = null; |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Column: map |
117
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
118
|
|
|
* @var mixed |
119
|
|
|
*/ |
120
|
|
|
public mixed $map = null; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* Column: before |
124
|
|
|
* Attributes: Type(23) |
125
|
|
|
* @var mixed |
126
|
|
|
*/ |
127
|
|
|
public mixed $before = null; |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* Column: after |
131
|
|
|
* Attributes: Type(23) |
132
|
|
|
* @var mixed |
133
|
|
|
*/ |
134
|
|
|
public mixed $after = null; |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Column: deleted |
138
|
|
|
* Attributes: NotNull | Numeric | Unsigned | Type(26) |
139
|
|
|
* @var mixed |
140
|
|
|
*/ |
141
|
|
|
public mixed $deleted = 0; |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Column: created_at |
145
|
|
|
* Attributes: NotNull | Type(4) |
146
|
|
|
* @var mixed |
147
|
|
|
*/ |
148
|
|
|
public mixed $createdAt = null; |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* Column: created_by |
152
|
|
|
* Attributes: Numeric | Unsigned |
153
|
|
|
* @var mixed |
154
|
|
|
*/ |
155
|
|
|
public mixed $createdBy = null; |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* Column: created_as |
159
|
|
|
* Attributes: Numeric | Unsigned |
160
|
|
|
* @var mixed |
161
|
|
|
*/ |
162
|
|
|
public mixed $createdAs = null; |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* Column: updated_at |
166
|
|
|
* Attributes: Type(4) |
167
|
|
|
* @var mixed |
168
|
|
|
*/ |
169
|
|
|
public mixed $updatedAt = null; |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* Column: updated_by |
173
|
|
|
* Attributes: Numeric | Unsigned |
174
|
|
|
* @var mixed |
175
|
|
|
*/ |
176
|
|
|
public mixed $updatedBy = null; |
177
|
|
|
|
178
|
|
|
/** |
179
|
|
|
* Column: updated_as |
180
|
|
|
* Attributes: Numeric | Unsigned |
181
|
|
|
* @var mixed |
182
|
|
|
*/ |
183
|
|
|
public mixed $updatedAs = null; |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* Column: deleted_at |
187
|
|
|
* Attributes: Type(4) |
188
|
|
|
* @var mixed |
189
|
|
|
*/ |
190
|
|
|
public mixed $deletedAt = null; |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* Column: deleted_by |
194
|
|
|
* Attributes: Numeric | Unsigned |
195
|
|
|
* @var mixed |
196
|
|
|
*/ |
197
|
|
|
public mixed $deletedBy = null; |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* Column: deleted_as |
201
|
|
|
* Attributes: Numeric | Unsigned |
202
|
|
|
* @var mixed |
203
|
|
|
*/ |
204
|
|
|
public mixed $deletedAs = null; |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* Column: restored_at |
208
|
|
|
* Attributes: Type(4) |
209
|
|
|
* @var mixed |
210
|
|
|
*/ |
211
|
|
|
public mixed $restoredAt = null; |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* Column: restored_by |
215
|
|
|
* Attributes: Numeric | Unsigned |
216
|
|
|
* @var mixed |
217
|
|
|
*/ |
218
|
|
|
public mixed $restoredBy = null; |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* Column: restored_as |
222
|
|
|
* Attributes: Numeric | Unsigned |
223
|
|
|
* @var mixed |
224
|
|
|
*/ |
225
|
|
|
public mixed $restoredAs = null; |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* Returns the value of field id |
229
|
|
|
* Column: id |
230
|
|
|
* Attributes: First | Primary | NotNull | Numeric | Unsigned | AutoIncrement | Type(14) |
231
|
|
|
* @return mixed |
232
|
|
|
*/ |
233
|
5 |
|
public function getId(): mixed |
234
|
|
|
{ |
235
|
5 |
|
return $this->id; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* Sets the value of field id |
240
|
|
|
* Column: id |
241
|
|
|
* Attributes: First | Primary | NotNull | Numeric | Unsigned | AutoIncrement | Type(14) |
242
|
|
|
* @param mixed $id |
243
|
|
|
* @return void |
244
|
|
|
*/ |
245
|
1 |
|
public function setId(mixed $id): void |
246
|
|
|
{ |
247
|
1 |
|
$this->id = $id; |
248
|
|
|
} |
249
|
|
|
|
250
|
|
|
/** |
251
|
|
|
* Returns the value of field auditId |
252
|
|
|
* Column: audit_id |
253
|
|
|
* Attributes: NotNull | Numeric | Unsigned | Type(14) |
254
|
|
|
* @return mixed |
255
|
|
|
*/ |
256
|
5 |
|
public function getAuditId(): mixed |
257
|
|
|
{ |
258
|
5 |
|
return $this->auditId; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* Sets the value of field auditId |
263
|
|
|
* Column: audit_id |
264
|
|
|
* Attributes: NotNull | Numeric | Unsigned | Type(14) |
265
|
|
|
* @param mixed $auditId |
266
|
|
|
* @return void |
267
|
|
|
*/ |
268
|
1 |
|
public function setAuditId(mixed $auditId): void |
269
|
|
|
{ |
270
|
1 |
|
$this->auditId = $auditId; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* Returns the value of field model |
275
|
|
|
* Column: model |
276
|
|
|
* Attributes: NotNull | Size(255) | Type(2) |
277
|
|
|
* @return mixed |
278
|
|
|
*/ |
279
|
5 |
|
public function getModel(): mixed |
280
|
|
|
{ |
281
|
5 |
|
return $this->model; |
282
|
|
|
} |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* Sets the value of field model |
286
|
|
|
* Column: model |
287
|
|
|
* Attributes: NotNull | Size(255) | Type(2) |
288
|
|
|
* @param mixed $model |
289
|
|
|
* @return void |
290
|
|
|
*/ |
291
|
1 |
|
public function setModel(mixed $model): void |
292
|
|
|
{ |
293
|
1 |
|
$this->model = $model; |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* Returns the value of field table |
298
|
|
|
* Column: table |
299
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
300
|
|
|
* @return mixed |
301
|
|
|
*/ |
302
|
5 |
|
public function getTable(): mixed |
303
|
|
|
{ |
304
|
5 |
|
return $this->table; |
305
|
|
|
} |
306
|
|
|
|
307
|
|
|
/** |
308
|
|
|
* Sets the value of field table |
309
|
|
|
* Column: table |
310
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
311
|
|
|
* @param mixed $table |
312
|
|
|
* @return void |
313
|
|
|
*/ |
314
|
4 |
|
public function setTable(mixed $table): void |
315
|
|
|
{ |
316
|
4 |
|
$this->table = $table; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* Returns the value of field primary |
321
|
|
|
* Column: primary |
322
|
|
|
* Attributes: NotNull | Numeric | Unsigned |
323
|
|
|
* @return mixed |
324
|
|
|
*/ |
325
|
5 |
|
public function getPrimary(): mixed |
326
|
|
|
{ |
327
|
5 |
|
return $this->primary; |
328
|
|
|
} |
329
|
|
|
|
330
|
|
|
/** |
331
|
|
|
* Sets the value of field primary |
332
|
|
|
* Column: primary |
333
|
|
|
* Attributes: NotNull | Numeric | Unsigned |
334
|
|
|
* @param mixed $primary |
335
|
|
|
* @return void |
336
|
|
|
*/ |
337
|
4 |
|
public function setPrimary(mixed $primary): void |
338
|
|
|
{ |
339
|
4 |
|
$this->primary = $primary; |
340
|
|
|
} |
341
|
|
|
|
342
|
|
|
/** |
343
|
|
|
* Returns the value of field event |
344
|
|
|
* Column: event |
345
|
|
|
* Attributes: NotNull | Size('create','update','delete','restore','other') | Type(18) |
346
|
|
|
* @return mixed |
347
|
|
|
*/ |
348
|
5 |
|
public function getEvent(): mixed |
349
|
|
|
{ |
350
|
5 |
|
return $this->event; |
351
|
|
|
} |
352
|
|
|
|
353
|
|
|
/** |
354
|
|
|
* Sets the value of field event |
355
|
|
|
* Column: event |
356
|
|
|
* Attributes: NotNull | Size('create','update','delete','restore','other') | Type(18) |
357
|
|
|
* @param mixed $event |
358
|
|
|
* @return void |
359
|
|
|
*/ |
360
|
4 |
|
public function setEvent(mixed $event): void |
361
|
|
|
{ |
362
|
4 |
|
$this->event = $event; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* Returns the value of field column |
367
|
|
|
* Column: column |
368
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
369
|
|
|
* @return mixed |
370
|
|
|
*/ |
371
|
5 |
|
public function getColumn(): mixed |
372
|
|
|
{ |
373
|
5 |
|
return $this->column; |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
/** |
377
|
|
|
* Sets the value of field column |
378
|
|
|
* Column: column |
379
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
380
|
|
|
* @param mixed $column |
381
|
|
|
* @return void |
382
|
|
|
*/ |
383
|
4 |
|
public function setColumn(mixed $column): void |
384
|
|
|
{ |
385
|
4 |
|
$this->column = $column; |
386
|
|
|
} |
387
|
|
|
|
388
|
|
|
/** |
389
|
|
|
* Returns the value of field map |
390
|
|
|
* Column: map |
391
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
392
|
|
|
* @return mixed |
393
|
|
|
*/ |
394
|
5 |
|
public function getMap(): mixed |
395
|
|
|
{ |
396
|
5 |
|
return $this->map; |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
/** |
400
|
|
|
* Sets the value of field map |
401
|
|
|
* Column: map |
402
|
|
|
* Attributes: NotNull | Size(60) | Type(2) |
403
|
|
|
* @param mixed $map |
404
|
|
|
* @return void |
405
|
|
|
*/ |
406
|
4 |
|
public function setMap(mixed $map): void |
407
|
|
|
{ |
408
|
4 |
|
$this->map = $map; |
409
|
|
|
} |
410
|
|
|
|
411
|
|
|
/** |
412
|
|
|
* Returns the value of field before |
413
|
|
|
* Column: before |
414
|
|
|
* Attributes: Type(23) |
415
|
|
|
* @return mixed |
416
|
|
|
*/ |
417
|
5 |
|
public function getBefore(): mixed |
418
|
|
|
{ |
419
|
5 |
|
return $this->before; |
420
|
|
|
} |
421
|
|
|
|
422
|
|
|
/** |
423
|
|
|
* Sets the value of field before |
424
|
|
|
* Column: before |
425
|
|
|
* Attributes: Type(23) |
426
|
|
|
* @param mixed $before |
427
|
|
|
* @return void |
428
|
|
|
*/ |
429
|
4 |
|
public function setBefore(mixed $before): void |
430
|
|
|
{ |
431
|
4 |
|
$this->before = $before; |
432
|
|
|
} |
433
|
|
|
|
434
|
|
|
/** |
435
|
|
|
* Returns the value of field after |
436
|
|
|
* Column: after |
437
|
|
|
* Attributes: Type(23) |
438
|
|
|
* @return mixed |
439
|
|
|
*/ |
440
|
5 |
|
public function getAfter(): mixed |
441
|
|
|
{ |
442
|
5 |
|
return $this->after; |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
/** |
446
|
|
|
* Sets the value of field after |
447
|
|
|
* Column: after |
448
|
|
|
* Attributes: Type(23) |
449
|
|
|
* @param mixed $after |
450
|
|
|
* @return void |
451
|
|
|
*/ |
452
|
4 |
|
public function setAfter(mixed $after): void |
453
|
|
|
{ |
454
|
4 |
|
$this->after = $after; |
455
|
|
|
} |
456
|
|
|
|
457
|
|
|
/** |
458
|
|
|
* Returns the value of field deleted |
459
|
|
|
* Column: deleted |
460
|
|
|
* Attributes: NotNull | Numeric | Unsigned | Type(26) |
461
|
|
|
* @return mixed |
462
|
|
|
*/ |
463
|
5 |
|
public function getDeleted(): mixed |
464
|
|
|
{ |
465
|
5 |
|
return $this->deleted; |
466
|
|
|
} |
467
|
|
|
|
468
|
|
|
/** |
469
|
|
|
* Sets the value of field deleted |
470
|
|
|
* Column: deleted |
471
|
|
|
* Attributes: NotNull | Numeric | Unsigned | Type(26) |
472
|
|
|
* @param mixed $deleted |
473
|
|
|
* @return void |
474
|
|
|
*/ |
475
|
1 |
|
public function setDeleted(mixed $deleted): void |
476
|
|
|
{ |
477
|
1 |
|
$this->deleted = $deleted; |
478
|
|
|
} |
479
|
|
|
|
480
|
|
|
/** |
481
|
|
|
* Returns the value of field createdAt |
482
|
|
|
* Column: created_at |
483
|
|
|
* Attributes: NotNull | Type(4) |
484
|
|
|
* @return mixed |
485
|
|
|
*/ |
486
|
5 |
|
public function getCreatedAt(): mixed |
487
|
|
|
{ |
488
|
5 |
|
return $this->createdAt; |
489
|
|
|
} |
490
|
|
|
|
491
|
|
|
/** |
492
|
|
|
* Sets the value of field createdAt |
493
|
|
|
* Column: created_at |
494
|
|
|
* Attributes: NotNull | Type(4) |
495
|
|
|
* @param mixed $createdAt |
496
|
|
|
* @return void |
497
|
|
|
*/ |
498
|
1 |
|
public function setCreatedAt(mixed $createdAt): void |
499
|
|
|
{ |
500
|
1 |
|
$this->createdAt = $createdAt; |
501
|
|
|
} |
502
|
|
|
|
503
|
|
|
/** |
504
|
|
|
* Returns the value of field createdBy |
505
|
|
|
* Column: created_by |
506
|
|
|
* Attributes: Numeric | Unsigned |
507
|
|
|
* @return mixed |
508
|
|
|
*/ |
509
|
5 |
|
public function getCreatedBy(): mixed |
510
|
|
|
{ |
511
|
5 |
|
return $this->createdBy; |
512
|
|
|
} |
513
|
|
|
|
514
|
|
|
/** |
515
|
|
|
* Sets the value of field createdBy |
516
|
|
|
* Column: created_by |
517
|
|
|
* Attributes: Numeric | Unsigned |
518
|
|
|
* @param mixed $createdBy |
519
|
|
|
* @return void |
520
|
|
|
*/ |
521
|
1 |
|
public function setCreatedBy(mixed $createdBy): void |
522
|
|
|
{ |
523
|
1 |
|
$this->createdBy = $createdBy; |
524
|
|
|
} |
525
|
|
|
|
526
|
|
|
/** |
527
|
|
|
* Returns the value of field createdAs |
528
|
|
|
* Column: created_as |
529
|
|
|
* Attributes: Numeric | Unsigned |
530
|
|
|
* @return mixed |
531
|
|
|
*/ |
532
|
5 |
|
public function getCreatedAs(): mixed |
533
|
|
|
{ |
534
|
5 |
|
return $this->createdAs; |
535
|
|
|
} |
536
|
|
|
|
537
|
|
|
/** |
538
|
|
|
* Sets the value of field createdAs |
539
|
|
|
* Column: created_as |
540
|
|
|
* Attributes: Numeric | Unsigned |
541
|
|
|
* @param mixed $createdAs |
542
|
|
|
* @return void |
543
|
|
|
*/ |
544
|
1 |
|
public function setCreatedAs(mixed $createdAs): void |
545
|
|
|
{ |
546
|
1 |
|
$this->createdAs = $createdAs; |
547
|
|
|
} |
548
|
|
|
|
549
|
|
|
/** |
550
|
|
|
* Returns the value of field updatedAt |
551
|
|
|
* Column: updated_at |
552
|
|
|
* Attributes: Type(4) |
553
|
|
|
* @return mixed |
554
|
|
|
*/ |
555
|
5 |
|
public function getUpdatedAt(): mixed |
556
|
|
|
{ |
557
|
5 |
|
return $this->updatedAt; |
558
|
|
|
} |
559
|
|
|
|
560
|
|
|
/** |
561
|
|
|
* Sets the value of field updatedAt |
562
|
|
|
* Column: updated_at |
563
|
|
|
* Attributes: Type(4) |
564
|
|
|
* @param mixed $updatedAt |
565
|
|
|
* @return void |
566
|
|
|
*/ |
567
|
1 |
|
public function setUpdatedAt(mixed $updatedAt): void |
568
|
|
|
{ |
569
|
1 |
|
$this->updatedAt = $updatedAt; |
570
|
|
|
} |
571
|
|
|
|
572
|
|
|
/** |
573
|
|
|
* Returns the value of field updatedBy |
574
|
|
|
* Column: updated_by |
575
|
|
|
* Attributes: Numeric | Unsigned |
576
|
|
|
* @return mixed |
577
|
|
|
*/ |
578
|
5 |
|
public function getUpdatedBy(): mixed |
579
|
|
|
{ |
580
|
5 |
|
return $this->updatedBy; |
581
|
|
|
} |
582
|
|
|
|
583
|
|
|
/** |
584
|
|
|
* Sets the value of field updatedBy |
585
|
|
|
* Column: updated_by |
586
|
|
|
* Attributes: Numeric | Unsigned |
587
|
|
|
* @param mixed $updatedBy |
588
|
|
|
* @return void |
589
|
|
|
*/ |
590
|
1 |
|
public function setUpdatedBy(mixed $updatedBy): void |
591
|
|
|
{ |
592
|
1 |
|
$this->updatedBy = $updatedBy; |
593
|
|
|
} |
594
|
|
|
|
595
|
|
|
/** |
596
|
|
|
* Returns the value of field updatedAs |
597
|
|
|
* Column: updated_as |
598
|
|
|
* Attributes: Numeric | Unsigned |
599
|
|
|
* @return mixed |
600
|
|
|
*/ |
601
|
5 |
|
public function getUpdatedAs(): mixed |
602
|
|
|
{ |
603
|
5 |
|
return $this->updatedAs; |
604
|
|
|
} |
605
|
|
|
|
606
|
|
|
/** |
607
|
|
|
* Sets the value of field updatedAs |
608
|
|
|
* Column: updated_as |
609
|
|
|
* Attributes: Numeric | Unsigned |
610
|
|
|
* @param mixed $updatedAs |
611
|
|
|
* @return void |
612
|
|
|
*/ |
613
|
1 |
|
public function setUpdatedAs(mixed $updatedAs): void |
614
|
|
|
{ |
615
|
1 |
|
$this->updatedAs = $updatedAs; |
616
|
|
|
} |
617
|
|
|
|
618
|
|
|
/** |
619
|
|
|
* Returns the value of field deletedAt |
620
|
|
|
* Column: deleted_at |
621
|
|
|
* Attributes: Type(4) |
622
|
|
|
* @return mixed |
623
|
|
|
*/ |
624
|
5 |
|
public function getDeletedAt(): mixed |
625
|
|
|
{ |
626
|
5 |
|
return $this->deletedAt; |
627
|
|
|
} |
628
|
|
|
|
629
|
|
|
/** |
630
|
|
|
* Sets the value of field deletedAt |
631
|
|
|
* Column: deleted_at |
632
|
|
|
* Attributes: Type(4) |
633
|
|
|
* @param mixed $deletedAt |
634
|
|
|
* @return void |
635
|
|
|
*/ |
636
|
1 |
|
public function setDeletedAt(mixed $deletedAt): void |
637
|
|
|
{ |
638
|
1 |
|
$this->deletedAt = $deletedAt; |
639
|
|
|
} |
640
|
|
|
|
641
|
|
|
/** |
642
|
|
|
* Returns the value of field deletedBy |
643
|
|
|
* Column: deleted_by |
644
|
|
|
* Attributes: Numeric | Unsigned |
645
|
|
|
* @return mixed |
646
|
|
|
*/ |
647
|
5 |
|
public function getDeletedBy(): mixed |
648
|
|
|
{ |
649
|
5 |
|
return $this->deletedBy; |
650
|
|
|
} |
651
|
|
|
|
652
|
|
|
/** |
653
|
|
|
* Sets the value of field deletedBy |
654
|
|
|
* Column: deleted_by |
655
|
|
|
* Attributes: Numeric | Unsigned |
656
|
|
|
* @param mixed $deletedBy |
657
|
|
|
* @return void |
658
|
|
|
*/ |
659
|
1 |
|
public function setDeletedBy(mixed $deletedBy): void |
660
|
|
|
{ |
661
|
1 |
|
$this->deletedBy = $deletedBy; |
662
|
|
|
} |
663
|
|
|
|
664
|
|
|
/** |
665
|
|
|
* Returns the value of field deletedAs |
666
|
|
|
* Column: deleted_as |
667
|
|
|
* Attributes: Numeric | Unsigned |
668
|
|
|
* @return mixed |
669
|
|
|
*/ |
670
|
5 |
|
public function getDeletedAs(): mixed |
671
|
|
|
{ |
672
|
5 |
|
return $this->deletedAs; |
673
|
|
|
} |
674
|
|
|
|
675
|
|
|
/** |
676
|
|
|
* Sets the value of field deletedAs |
677
|
|
|
* Column: deleted_as |
678
|
|
|
* Attributes: Numeric | Unsigned |
679
|
|
|
* @param mixed $deletedAs |
680
|
|
|
* @return void |
681
|
|
|
*/ |
682
|
1 |
|
public function setDeletedAs(mixed $deletedAs): void |
683
|
|
|
{ |
684
|
1 |
|
$this->deletedAs = $deletedAs; |
685
|
|
|
} |
686
|
|
|
|
687
|
|
|
/** |
688
|
|
|
* Returns the value of field restoredAt |
689
|
|
|
* Column: restored_at |
690
|
|
|
* Attributes: Type(4) |
691
|
|
|
* @return mixed |
692
|
|
|
*/ |
693
|
5 |
|
public function getRestoredAt(): mixed |
694
|
|
|
{ |
695
|
5 |
|
return $this->restoredAt; |
696
|
|
|
} |
697
|
|
|
|
698
|
|
|
/** |
699
|
|
|
* Sets the value of field restoredAt |
700
|
|
|
* Column: restored_at |
701
|
|
|
* Attributes: Type(4) |
702
|
|
|
* @param mixed $restoredAt |
703
|
|
|
* @return void |
704
|
|
|
*/ |
705
|
1 |
|
public function setRestoredAt(mixed $restoredAt): void |
706
|
|
|
{ |
707
|
1 |
|
$this->restoredAt = $restoredAt; |
708
|
|
|
} |
709
|
|
|
|
710
|
|
|
/** |
711
|
|
|
* Returns the value of field restoredBy |
712
|
|
|
* Column: restored_by |
713
|
|
|
* Attributes: Numeric | Unsigned |
714
|
|
|
* @return mixed |
715
|
|
|
*/ |
716
|
5 |
|
public function getRestoredBy(): mixed |
717
|
|
|
{ |
718
|
5 |
|
return $this->restoredBy; |
719
|
|
|
} |
720
|
|
|
|
721
|
|
|
/** |
722
|
|
|
* Sets the value of field restoredBy |
723
|
|
|
* Column: restored_by |
724
|
|
|
* Attributes: Numeric | Unsigned |
725
|
|
|
* @param mixed $restoredBy |
726
|
|
|
* @return void |
727
|
|
|
*/ |
728
|
1 |
|
public function setRestoredBy(mixed $restoredBy): void |
729
|
|
|
{ |
730
|
1 |
|
$this->restoredBy = $restoredBy; |
731
|
|
|
} |
732
|
|
|
|
733
|
|
|
/** |
734
|
|
|
* Returns the value of field restoredAs |
735
|
|
|
* Column: restored_as |
736
|
|
|
* Attributes: Numeric | Unsigned |
737
|
|
|
* @return mixed |
738
|
|
|
*/ |
739
|
5 |
|
public function getRestoredAs(): mixed |
740
|
|
|
{ |
741
|
5 |
|
return $this->restoredAs; |
742
|
|
|
} |
743
|
|
|
|
744
|
|
|
/** |
745
|
|
|
* Sets the value of field restoredAs |
746
|
|
|
* Column: restored_as |
747
|
|
|
* Attributes: Numeric | Unsigned |
748
|
|
|
* @param mixed $restoredAs |
749
|
|
|
* @return void |
750
|
|
|
*/ |
751
|
1 |
|
public function setRestoredAs(mixed $restoredAs): void |
752
|
|
|
{ |
753
|
1 |
|
$this->restoredAs = $restoredAs; |
754
|
|
|
} |
755
|
|
|
|
756
|
|
|
/** |
757
|
|
|
* Adds the default relationships to the model. |
758
|
|
|
* @return void |
759
|
|
|
*/ |
760
|
5 |
|
public function addDefaultRelationships(): void |
761
|
|
|
{ |
762
|
5 |
|
$this->belongsTo('auditId', Audit::class, 'id', ['alias' => 'AuditEntity']); |
763
|
|
|
|
764
|
5 |
|
$this->belongsTo('createdBy', User::class, 'id', ['alias' => 'CreatedByEntity']); |
765
|
|
|
|
766
|
5 |
|
$this->belongsTo('createdAs', User::class, 'id', ['alias' => 'CreatedAsEntity']); |
767
|
|
|
|
768
|
5 |
|
$this->belongsTo('updatedBy', User::class, 'id', ['alias' => 'UpdatedByEntity']); |
769
|
|
|
|
770
|
5 |
|
$this->belongsTo('updatedAs', User::class, 'id', ['alias' => 'UpdatedAsEntity']); |
771
|
|
|
|
772
|
5 |
|
$this->belongsTo('deletedBy', User::class, 'id', ['alias' => 'DeletedByEntity']); |
773
|
|
|
|
774
|
5 |
|
$this->belongsTo('deletedAs', User::class, 'id', ['alias' => 'DeletedAsEntity']); |
775
|
|
|
|
776
|
5 |
|
$this->belongsTo('restoredBy', User::class, 'id', ['alias' => 'RestoredByEntity']); |
777
|
|
|
|
778
|
5 |
|
$this->belongsTo('restoredAs', User::class, 'id', ['alias' => 'RestoredAsEntity']); |
779
|
|
|
} |
780
|
|
|
|
781
|
|
|
/** |
782
|
|
|
* Adds the default validations to the model. |
783
|
|
|
* @param Validation|null $validator |
784
|
|
|
* @return Validation |
785
|
|
|
*/ |
786
|
3 |
|
public function addDefaultValidations(?Validation $validator = null): Validation |
787
|
|
|
{ |
788
|
3 |
|
$validator ??= new Validation(); |
789
|
|
|
|
790
|
3 |
|
$this->addUnsignedIntValidation($validator, 'id', true); |
791
|
3 |
|
$this->addUnsignedIntValidation($validator, 'auditId', false); |
792
|
3 |
|
$this->addStringLengthValidation($validator, 'model', 0, 255, false); |
793
|
3 |
|
$this->addStringLengthValidation($validator, 'table', 0, 60, false); |
794
|
3 |
|
$this->addUnsignedIntValidation($validator, 'primary', false); |
795
|
3 |
|
$this->addInclusionInValidation($validator, 'event', ['create','update','delete','restore','other'], false); |
796
|
3 |
|
$this->addStringLengthValidation($validator, 'column', 0, 60, false); |
797
|
3 |
|
$this->addStringLengthValidation($validator, 'map', 0, 60, false); |
798
|
3 |
|
$this->addUnsignedIntValidation($validator, 'deleted', false); |
799
|
3 |
|
$this->addDateTimeValidation($validator, 'createdAt', false); |
800
|
3 |
|
$this->addUnsignedIntValidation($validator, 'createdBy', true); |
801
|
3 |
|
$this->addUnsignedIntValidation($validator, 'createdAs', true); |
802
|
3 |
|
$this->addDateTimeValidation($validator, 'updatedAt', true); |
803
|
3 |
|
$this->addUnsignedIntValidation($validator, 'updatedBy', true); |
804
|
3 |
|
$this->addUnsignedIntValidation($validator, 'updatedAs', true); |
805
|
3 |
|
$this->addDateTimeValidation($validator, 'deletedAt', true); |
806
|
3 |
|
$this->addUnsignedIntValidation($validator, 'deletedBy', true); |
807
|
3 |
|
$this->addUnsignedIntValidation($validator, 'deletedAs', true); |
808
|
3 |
|
$this->addDateTimeValidation($validator, 'restoredAt', true); |
809
|
3 |
|
$this->addUnsignedIntValidation($validator, 'restoredBy', true); |
810
|
3 |
|
$this->addUnsignedIntValidation($validator, 'restoredAs', true); |
811
|
|
|
|
812
|
3 |
|
return $validator; |
813
|
|
|
} |
814
|
|
|
|
815
|
|
|
|
816
|
|
|
/** |
817
|
|
|
* Returns an array that maps the column names of the database |
818
|
|
|
* table to the corresponding property names of the model. |
819
|
|
|
* |
820
|
|
|
* @returns array The array mapping the column names to the property names |
821
|
|
|
*/ |
822
|
4 |
|
public function columnMap(): array |
823
|
|
|
{ |
824
|
4 |
|
return [ |
825
|
4 |
|
'id' => 'id', |
826
|
4 |
|
'audit_id' => 'auditId', |
827
|
4 |
|
'model' => 'model', |
828
|
4 |
|
'table' => 'table', |
829
|
4 |
|
'primary' => 'primary', |
830
|
4 |
|
'event' => 'event', |
831
|
4 |
|
'column' => 'column', |
832
|
4 |
|
'map' => 'map', |
833
|
4 |
|
'before' => 'before', |
834
|
4 |
|
'after' => 'after', |
835
|
4 |
|
'deleted' => 'deleted', |
836
|
4 |
|
'created_at' => 'createdAt', |
837
|
4 |
|
'created_by' => 'createdBy', |
838
|
4 |
|
'created_as' => 'createdAs', |
839
|
4 |
|
'updated_at' => 'updatedAt', |
840
|
4 |
|
'updated_by' => 'updatedBy', |
841
|
4 |
|
'updated_as' => 'updatedAs', |
842
|
4 |
|
'deleted_at' => 'deletedAt', |
843
|
4 |
|
'deleted_by' => 'deletedBy', |
844
|
4 |
|
'deleted_as' => 'deletedAs', |
845
|
4 |
|
'restored_at' => 'restoredAt', |
846
|
4 |
|
'restored_by' => 'restoredBy', |
847
|
4 |
|
'restored_as' => 'restoredAs', |
848
|
4 |
|
]; |
849
|
|
|
} |
850
|
|
|
} |
851
|
|
|
|