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