Passed
Push — 1.0.x ( 8353d5...3a2c37 )
by Julien
21:28
created

LangAbstract::setDeletedAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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\Category;
19
use Zemit\Models\Site;
20
use Zemit\Models\Flag;
21
use Zemit\Models\Page;
22
use Zemit\Models\Meta;
23
use Zemit\Models\Post;
24
use Zemit\Models\SiteLang;
25
use Zemit\Models\Table;
26
use Zemit\Models\Workspace;
27
use Zemit\Models\Translate;
28
use Zemit\Models\TranslateField;
29
use Zemit\Models\WorkspaceLang;
30
use Zemit\Models\User;
31
use Zemit\Models\Abstracts\Interfaces\LangAbstractInterface;
32
33
/**
34
 * Class LangAbstract
35
 *
36
 * This class defines a Lang abstract model that extends the AbstractModel class and implements the LangAbstractInterface.
37
 * It provides properties and methods for managing Lang data.
38
 * 
39
 * @property Category[] $categorylist
40
 * @property Category[] $CategoryList
41
 * @method Category[] getCategoryList(?array $params = null)
42
 *
43
 * @property Site[] $categorysitelist
44
 * @property Site[] $CategorySiteList
45
 * @method Site[] getCategorySiteList(?array $params = null)
46
 *
47
 * @property Flag[] $flaglist
48
 * @property Flag[] $FlagList
49
 * @method Flag[] getFlagList(?array $params = null)
50
 *
51
 * @property Site[] $flagsitelist
52
 * @property Site[] $FlagSiteList
53
 * @method Site[] getFlagSiteList(?array $params = null)
54
 *
55
 * @property Page[] $flagpagelist
56
 * @property Page[] $FlagPageList
57
 * @method Page[] getFlagPageList(?array $params = null)
58
 *
59
 * @property Meta[] $metalist
60
 * @property Meta[] $MetaList
61
 * @method Meta[] getMetaList(?array $params = null)
62
 *
63
 * @property Site[] $metasitelist
64
 * @property Site[] $MetaSiteList
65
 * @method Site[] getMetaSiteList(?array $params = null)
66
 *
67
 * @property Page[] $metapagelist
68
 * @property Page[] $MetaPageList
69
 * @method Page[] getMetaPageList(?array $params = null)
70
 *
71
 * @property Post[] $metapostlist
72
 * @property Post[] $MetaPostList
73
 * @method Post[] getMetaPostList(?array $params = null)
74
 *
75
 * @property Category[] $metacategorylist
76
 * @property Category[] $MetaCategoryList
77
 * @method Category[] getMetaCategoryList(?array $params = null)
78
 *
79
 * @property Page[] $pagelist
80
 * @property Page[] $PageList
81
 * @method Page[] getPageList(?array $params = null)
82
 *
83
 * @property Site[] $pagesitelist
84
 * @property Site[] $PageSiteList
85
 * @method Site[] getPageSiteList(?array $params = null)
86
 *
87
 * @property Post[] $postlist
88
 * @property Post[] $PostList
89
 * @method Post[] getPostList(?array $params = null)
90
 *
91
 * @property Site[] $postsitelist
92
 * @property Site[] $PostSiteList
93
 * @method Site[] getPostSiteList(?array $params = null)
94
 *
95
 * @property Page[] $postpagelist
96
 * @property Page[] $PostPageList
97
 * @method Page[] getPostPageList(?array $params = null)
98
 *
99
 * @property SiteLang[] $sitelanglist
100
 * @property SiteLang[] $SiteLangList
101
 * @method SiteLang[] getSiteLangList(?array $params = null)
102
 *
103
 * @property Site[] $sitelist
104
 * @property Site[] $SiteList
105
 * @method Site[] getSiteList(?array $params = null)
106
 *
107
 * @property Table[] $tablelist
108
 * @property Table[] $TableList
109
 * @method Table[] getTableList(?array $params = null)
110
 *
111
 * @property Workspace[] $tableworkspacelist
112
 * @property Workspace[] $TableWorkspaceList
113
 * @method Workspace[] getTableWorkspaceList(?array $params = null)
114
 *
115
 * @property Translate[] $translatelist
116
 * @property Translate[] $TranslateList
117
 * @method Translate[] getTranslateList(?array $params = null)
118
 *
119
 * @property Site[] $translatesitelist
120
 * @property Site[] $TranslateSiteList
121
 * @method Site[] getTranslateSiteList(?array $params = null)
122
 *
123
 * @property Page[] $translatepagelist
124
 * @property Page[] $TranslatePageList
125
 * @method Page[] getTranslatePageList(?array $params = null)
126
 *
127
 * @property Post[] $translatepostlist
128
 * @property Post[] $TranslatePostList
129
 * @method Post[] getTranslatePostList(?array $params = null)
130
 *
131
 * @property Category[] $translatecategorylist
132
 * @property Category[] $TranslateCategoryList
133
 * @method Category[] getTranslateCategoryList(?array $params = null)
134
 *
135
 * @property TranslateField[] $translatefieldlist
136
 * @property TranslateField[] $TranslateFieldList
137
 * @method TranslateField[] getTranslateFieldList(?array $params = null)
138
 *
139
 * @property Site[] $translatefieldsitelist
140
 * @property Site[] $TranslateFieldSiteList
141
 * @method Site[] getTranslateFieldSiteList(?array $params = null)
142
 *
143
 * @property Table[] $translatefieldtablelist
144
 * @property Table[] $TranslateFieldTableList
145
 * @method Table[] getTranslateFieldTableList(?array $params = null)
146
 *
147
 * @property WorkspaceLang[] $workspacelanglist
148
 * @property WorkspaceLang[] $WorkspaceLangList
149
 * @method WorkspaceLang[] getWorkspaceLangList(?array $params = null)
150
 *
151
 * @property Workspace[] $workspacelist
152
 * @property Workspace[] $WorkspaceList
153
 * @method Workspace[] getWorkspaceList(?array $params = null)
154
 *
155
 * @property User $createdbyentity
156
 * @property User $CreatedByEntity
157
 * @method User getCreatedByEntity(?array $params = null)
158
 *
159
 * @property User $createdasentity
160
 * @property User $CreatedAsEntity
161
 * @method User getCreatedAsEntity(?array $params = null)
162
 *
163
 * @property User $updatedbyentity
164
 * @property User $UpdatedByEntity
165
 * @method User getUpdatedByEntity(?array $params = null)
166
 *
167
 * @property User $updatedasentity
168
 * @property User $UpdatedAsEntity
169
 * @method User getUpdatedAsEntity(?array $params = null)
170
 *
171
 * @property User $deletedasentity
172
 * @property User $DeletedAsEntity
173
 * @method User getDeletedAsEntity(?array $params = null)
174
 *
175
 * @property User $deletedbyentity
176
 * @property User $DeletedByEntity
177
 * @method User getDeletedByEntity(?array $params = null)
178
 *
179
 * @property User $restoredbyentity
180
 * @property User $RestoredByEntity
181
 * @method User getRestoredByEntity(?array $params = null)
182
 */
183
abstract class LangAbstract extends AbstractModel implements LangAbstractInterface
184
{
185
    /**
186
     * Column: id
187
     * Attributes: First | Primary | NotNull | Numeric | Unsigned | AutoIncrement
188
     * @var mixed
189
     */
190
    public mixed $id = null;
191
        
192
    /**
193
     * Column: label
194
     * Attributes: NotNull | Size(255) | Type(2)
195
     * @var mixed
196
     */
197
    public mixed $label = null;
198
        
199
    /**
200
     * Column: code
201
     * Attributes: NotNull | Size(10) | Type(5)
202
     * @var mixed
203
     */
204
    public mixed $code = null;
205
        
206
    /**
207
     * Column: deleted
208
     * Attributes: NotNull | Numeric | Unsigned | Type(26)
209
     * @var mixed
210
     */
211
    public mixed $deleted = 0;
212
        
213
    /**
214
     * Column: created_at
215
     * Attributes: NotNull | Type(4)
216
     * @var mixed
217
     */
218
    public mixed $createdAt = null;
219
        
220
    /**
221
     * Column: created_by
222
     * Attributes: Numeric | Unsigned
223
     * @var mixed
224
     */
225
    public mixed $createdBy = null;
226
        
227
    /**
228
     * Column: created_as
229
     * Attributes: Numeric | Unsigned
230
     * @var mixed
231
     */
232
    public mixed $createdAs = null;
233
        
234
    /**
235
     * Column: updated_at
236
     * Attributes: Type(4)
237
     * @var mixed
238
     */
239
    public mixed $updatedAt = null;
240
        
241
    /**
242
     * Column: updated_by
243
     * Attributes: Numeric | Unsigned
244
     * @var mixed
245
     */
246
    public mixed $updatedBy = null;
247
        
248
    /**
249
     * Column: updated_as
250
     * Attributes: Numeric | Unsigned
251
     * @var mixed
252
     */
253
    public mixed $updatedAs = null;
254
        
255
    /**
256
     * Column: deleted_at
257
     * Attributes: Type(4)
258
     * @var mixed
259
     */
260
    public mixed $deletedAt = null;
261
        
262
    /**
263
     * Column: deleted_as
264
     * Attributes: Numeric | Unsigned
265
     * @var mixed
266
     */
267
    public mixed $deletedAs = null;
268
        
269
    /**
270
     * Column: deleted_by
271
     * Attributes: Numeric | Unsigned
272
     * @var mixed
273
     */
274
    public mixed $deletedBy = null;
275
        
276
    /**
277
     * Column: restored_at
278
     * Attributes: Type(4)
279
     * @var mixed
280
     */
281
    public mixed $restoredAt = null;
282
        
283
    /**
284
     * Column: restored_by
285
     * Attributes: Numeric | Unsigned
286
     * @var mixed
287
     */
288
    public mixed $restoredBy = null;
289
    
290
    /**
291
     * Returns the value of field id
292
     * Column: id
293
     * Attributes: First | Primary | NotNull | Numeric | Unsigned | AutoIncrement
294
     * @return mixed
295
     */
296
    public function getId(): mixed
297
    {
298
        return $this->id;
299
    }
300
    
301
    /**
302
     * Sets the value of field id
303
     * Column: id 
304
     * Attributes: First | Primary | NotNull | Numeric | Unsigned | AutoIncrement
305
     * @param mixed $id
306
     * @return void
307
     */
308
    public function setId(mixed $id): void
309
    {
310
        $this->id = $id;
311
    }
312
    
313
    /**
314
     * Returns the value of field label
315
     * Column: label
316
     * Attributes: NotNull | Size(255) | Type(2)
317
     * @return mixed
318
     */
319
    public function getLabel(): mixed
320
    {
321
        return $this->label;
322
    }
323
    
324
    /**
325
     * Sets the value of field label
326
     * Column: label 
327
     * Attributes: NotNull | Size(255) | Type(2)
328
     * @param mixed $label
329
     * @return void
330
     */
331
    public function setLabel(mixed $label): void
332
    {
333
        $this->label = $label;
334
    }
335
    
336
    /**
337
     * Returns the value of field code
338
     * Column: code
339
     * Attributes: NotNull | Size(10) | Type(5)
340
     * @return mixed
341
     */
342
    public function getCode(): mixed
343
    {
344
        return $this->code;
345
    }
346
    
347
    /**
348
     * Sets the value of field code
349
     * Column: code 
350
     * Attributes: NotNull | Size(10) | Type(5)
351
     * @param mixed $code
352
     * @return void
353
     */
354
    public function setCode(mixed $code): void
355
    {
356
        $this->code = $code;
357
    }
358
    
359
    /**
360
     * Returns the value of field deleted
361
     * Column: deleted
362
     * Attributes: NotNull | Numeric | Unsigned | Type(26)
363
     * @return mixed
364
     */
365
    public function getDeleted(): mixed
366
    {
367
        return $this->deleted;
368
    }
369
    
370
    /**
371
     * Sets the value of field deleted
372
     * Column: deleted 
373
     * Attributes: NotNull | Numeric | Unsigned | Type(26)
374
     * @param mixed $deleted
375
     * @return void
376
     */
377
    public function setDeleted(mixed $deleted): void
378
    {
379
        $this->deleted = $deleted;
380
    }
381
    
382
    /**
383
     * Returns the value of field createdAt
384
     * Column: created_at
385
     * Attributes: NotNull | Type(4)
386
     * @return mixed
387
     */
388
    public function getCreatedAt(): mixed
389
    {
390
        return $this->createdAt;
391
    }
392
    
393
    /**
394
     * Sets the value of field createdAt
395
     * Column: created_at 
396
     * Attributes: NotNull | Type(4)
397
     * @param mixed $createdAt
398
     * @return void
399
     */
400
    public function setCreatedAt(mixed $createdAt): void
401
    {
402
        $this->createdAt = $createdAt;
403
    }
404
    
405
    /**
406
     * Returns the value of field createdBy
407
     * Column: created_by
408
     * Attributes: Numeric | Unsigned
409
     * @return mixed
410
     */
411
    public function getCreatedBy(): mixed
412
    {
413
        return $this->createdBy;
414
    }
415
    
416
    /**
417
     * Sets the value of field createdBy
418
     * Column: created_by 
419
     * Attributes: Numeric | Unsigned
420
     * @param mixed $createdBy
421
     * @return void
422
     */
423
    public function setCreatedBy(mixed $createdBy): void
424
    {
425
        $this->createdBy = $createdBy;
426
    }
427
    
428
    /**
429
     * Returns the value of field createdAs
430
     * Column: created_as
431
     * Attributes: Numeric | Unsigned
432
     * @return mixed
433
     */
434
    public function getCreatedAs(): mixed
435
    {
436
        return $this->createdAs;
437
    }
438
    
439
    /**
440
     * Sets the value of field createdAs
441
     * Column: created_as 
442
     * Attributes: Numeric | Unsigned
443
     * @param mixed $createdAs
444
     * @return void
445
     */
446
    public function setCreatedAs(mixed $createdAs): void
447
    {
448
        $this->createdAs = $createdAs;
449
    }
450
    
451
    /**
452
     * Returns the value of field updatedAt
453
     * Column: updated_at
454
     * Attributes: Type(4)
455
     * @return mixed
456
     */
457
    public function getUpdatedAt(): mixed
458
    {
459
        return $this->updatedAt;
460
    }
461
    
462
    /**
463
     * Sets the value of field updatedAt
464
     * Column: updated_at 
465
     * Attributes: Type(4)
466
     * @param mixed $updatedAt
467
     * @return void
468
     */
469
    public function setUpdatedAt(mixed $updatedAt): void
470
    {
471
        $this->updatedAt = $updatedAt;
472
    }
473
    
474
    /**
475
     * Returns the value of field updatedBy
476
     * Column: updated_by
477
     * Attributes: Numeric | Unsigned
478
     * @return mixed
479
     */
480
    public function getUpdatedBy(): mixed
481
    {
482
        return $this->updatedBy;
483
    }
484
    
485
    /**
486
     * Sets the value of field updatedBy
487
     * Column: updated_by 
488
     * Attributes: Numeric | Unsigned
489
     * @param mixed $updatedBy
490
     * @return void
491
     */
492
    public function setUpdatedBy(mixed $updatedBy): void
493
    {
494
        $this->updatedBy = $updatedBy;
495
    }
496
    
497
    /**
498
     * Returns the value of field updatedAs
499
     * Column: updated_as
500
     * Attributes: Numeric | Unsigned
501
     * @return mixed
502
     */
503
    public function getUpdatedAs(): mixed
504
    {
505
        return $this->updatedAs;
506
    }
507
    
508
    /**
509
     * Sets the value of field updatedAs
510
     * Column: updated_as 
511
     * Attributes: Numeric | Unsigned
512
     * @param mixed $updatedAs
513
     * @return void
514
     */
515
    public function setUpdatedAs(mixed $updatedAs): void
516
    {
517
        $this->updatedAs = $updatedAs;
518
    }
519
    
520
    /**
521
     * Returns the value of field deletedAt
522
     * Column: deleted_at
523
     * Attributes: Type(4)
524
     * @return mixed
525
     */
526
    public function getDeletedAt(): mixed
527
    {
528
        return $this->deletedAt;
529
    }
530
    
531
    /**
532
     * Sets the value of field deletedAt
533
     * Column: deleted_at 
534
     * Attributes: Type(4)
535
     * @param mixed $deletedAt
536
     * @return void
537
     */
538
    public function setDeletedAt(mixed $deletedAt): void
539
    {
540
        $this->deletedAt = $deletedAt;
541
    }
542
    
543
    /**
544
     * Returns the value of field deletedAs
545
     * Column: deleted_as
546
     * Attributes: Numeric | Unsigned
547
     * @return mixed
548
     */
549
    public function getDeletedAs(): mixed
550
    {
551
        return $this->deletedAs;
552
    }
553
    
554
    /**
555
     * Sets the value of field deletedAs
556
     * Column: deleted_as 
557
     * Attributes: Numeric | Unsigned
558
     * @param mixed $deletedAs
559
     * @return void
560
     */
561
    public function setDeletedAs(mixed $deletedAs): void
562
    {
563
        $this->deletedAs = $deletedAs;
564
    }
565
    
566
    /**
567
     * Returns the value of field deletedBy
568
     * Column: deleted_by
569
     * Attributes: Numeric | Unsigned
570
     * @return mixed
571
     */
572
    public function getDeletedBy(): mixed
573
    {
574
        return $this->deletedBy;
575
    }
576
    
577
    /**
578
     * Sets the value of field deletedBy
579
     * Column: deleted_by 
580
     * Attributes: Numeric | Unsigned
581
     * @param mixed $deletedBy
582
     * @return void
583
     */
584
    public function setDeletedBy(mixed $deletedBy): void
585
    {
586
        $this->deletedBy = $deletedBy;
587
    }
588
    
589
    /**
590
     * Returns the value of field restoredAt
591
     * Column: restored_at
592
     * Attributes: Type(4)
593
     * @return mixed
594
     */
595
    public function getRestoredAt(): mixed
596
    {
597
        return $this->restoredAt;
598
    }
599
    
600
    /**
601
     * Sets the value of field restoredAt
602
     * Column: restored_at 
603
     * Attributes: Type(4)
604
     * @param mixed $restoredAt
605
     * @return void
606
     */
607
    public function setRestoredAt(mixed $restoredAt): void
608
    {
609
        $this->restoredAt = $restoredAt;
610
    }
611
    
612
    /**
613
     * Returns the value of field restoredBy
614
     * Column: restored_by
615
     * Attributes: Numeric | Unsigned
616
     * @return mixed
617
     */
618
    public function getRestoredBy(): mixed
619
    {
620
        return $this->restoredBy;
621
    }
622
    
623
    /**
624
     * Sets the value of field restoredBy
625
     * Column: restored_by 
626
     * Attributes: Numeric | Unsigned
627
     * @param mixed $restoredBy
628
     * @return void
629
     */
630
    public function setRestoredBy(mixed $restoredBy): void
631
    {
632
        $this->restoredBy = $restoredBy;
633
    }
634
635
    /**
636
     * Adds the default relationships to the model.
637
     * @return void
638
     */
639
    public function addDefaultRelationships(): void
640
    {
641
        $this->hasMany('id', Category::class, 'langId', ['alias' => 'CategoryList']);
642
643
        $this->hasManyToMany(
644
            'id',
645
            Category::class,
646
            'langId',
647
            'siteId',
648
            Site::class,
649
            'id',
650
            ['alias' => 'CategorySiteList']
651
        );
652
653
        $this->hasMany('id', Flag::class, 'langId', ['alias' => 'FlagList']);
654
655
        $this->hasManyToMany(
656
            'id',
657
            Flag::class,
658
            'langId',
659
            'siteId',
660
            Site::class,
661
            'id',
662
            ['alias' => 'FlagSiteList']
663
        );
664
665
        $this->hasManyToMany(
666
            'id',
667
            Flag::class,
668
            'langId',
669
            'pageId',
670
            Page::class,
671
            'id',
672
            ['alias' => 'FlagPageList']
673
        );
674
675
        $this->hasMany('id', Meta::class, 'langId', ['alias' => 'MetaList']);
676
677
        $this->hasManyToMany(
678
            'id',
679
            Meta::class,
680
            'langId',
681
            'siteId',
682
            Site::class,
683
            'id',
684
            ['alias' => 'MetaSiteList']
685
        );
686
687
        $this->hasManyToMany(
688
            'id',
689
            Meta::class,
690
            'langId',
691
            'pageId',
692
            Page::class,
693
            'id',
694
            ['alias' => 'MetaPageList']
695
        );
696
697
        $this->hasManyToMany(
698
            'id',
699
            Meta::class,
700
            'langId',
701
            'postId',
702
            Post::class,
703
            'id',
704
            ['alias' => 'MetaPostList']
705
        );
706
707
        $this->hasManyToMany(
708
            'id',
709
            Meta::class,
710
            'langId',
711
            'categoryId',
712
            Category::class,
713
            'id',
714
            ['alias' => 'MetaCategoryList']
715
        );
716
717
        $this->hasMany('id', Page::class, 'langId', ['alias' => 'PageList']);
718
719
        $this->hasManyToMany(
720
            'id',
721
            Page::class,
722
            'langId',
723
            'siteId',
724
            Site::class,
725
            'id',
726
            ['alias' => 'PageSiteList']
727
        );
728
729
        $this->hasMany('id', Post::class, 'langId', ['alias' => 'PostList']);
730
731
        $this->hasManyToMany(
732
            'id',
733
            Post::class,
734
            'langId',
735
            'siteId',
736
            Site::class,
737
            'id',
738
            ['alias' => 'PostSiteList']
739
        );
740
741
        $this->hasManyToMany(
742
            'id',
743
            Post::class,
744
            'langId',
745
            'pageId',
746
            Page::class,
747
            'id',
748
            ['alias' => 'PostPageList']
749
        );
750
751
        $this->hasMany('id', SiteLang::class, 'langId', ['alias' => 'SiteLangList']);
752
753
        $this->hasManyToMany(
754
            'id',
755
            SiteLang::class,
756
            'langId',
757
            'siteId',
758
            Site::class,
759
            'id',
760
            ['alias' => 'SiteList']
761
        );
762
763
        $this->hasMany('id', Table::class, 'langId', ['alias' => 'TableList']);
764
765
        $this->hasManyToMany(
766
            'id',
767
            Table::class,
768
            'langId',
769
            'workspaceId',
770
            Workspace::class,
771
            'id',
772
            ['alias' => 'TableWorkspaceList']
773
        );
774
775
        $this->hasMany('id', Translate::class, 'langId', ['alias' => 'TranslateList']);
776
777
        $this->hasManyToMany(
778
            'id',
779
            Translate::class,
780
            'langId',
781
            'siteId',
782
            Site::class,
783
            'id',
784
            ['alias' => 'TranslateSiteList']
785
        );
786
787
        $this->hasManyToMany(
788
            'id',
789
            Translate::class,
790
            'langId',
791
            'pageId',
792
            Page::class,
793
            'id',
794
            ['alias' => 'TranslatePageList']
795
        );
796
797
        $this->hasManyToMany(
798
            'id',
799
            Translate::class,
800
            'langId',
801
            'postId',
802
            Post::class,
803
            'id',
804
            ['alias' => 'TranslatePostList']
805
        );
806
807
        $this->hasManyToMany(
808
            'id',
809
            Translate::class,
810
            'langId',
811
            'categoryId',
812
            Category::class,
813
            'id',
814
            ['alias' => 'TranslateCategoryList']
815
        );
816
817
        $this->hasMany('id', TranslateField::class, 'langId', ['alias' => 'TranslateFieldList']);
818
819
        $this->hasManyToMany(
820
            'id',
821
            TranslateField::class,
822
            'langId',
823
            'siteId',
824
            Site::class,
825
            'id',
826
            ['alias' => 'TranslateFieldSiteList']
827
        );
828
829
        $this->hasManyToMany(
830
            'id',
831
            TranslateField::class,
832
            'langId',
833
            'tableId',
834
            Table::class,
835
            'id',
836
            ['alias' => 'TranslateFieldTableList']
837
        );
838
839
        $this->hasMany('id', WorkspaceLang::class, 'langId', ['alias' => 'WorkspaceLangList']);
840
841
        $this->hasManyToMany(
842
            'id',
843
            WorkspaceLang::class,
844
            'langId',
845
            'workspaceId',
846
            Workspace::class,
847
            'id',
848
            ['alias' => 'WorkspaceList']
849
        );
850
851
        $this->belongsTo('createdBy', User::class, 'id', ['alias' => 'CreatedByEntity']);
852
853
        $this->belongsTo('createdAs', User::class, 'id', ['alias' => 'CreatedAsEntity']);
854
855
        $this->belongsTo('updatedBy', User::class, 'id', ['alias' => 'UpdatedByEntity']);
856
857
        $this->belongsTo('updatedAs', User::class, 'id', ['alias' => 'UpdatedAsEntity']);
858
859
        $this->belongsTo('deletedAs', User::class, 'id', ['alias' => 'DeletedAsEntity']);
860
861
        $this->belongsTo('deletedBy', User::class, 'id', ['alias' => 'DeletedByEntity']);
862
863
        $this->belongsTo('restoredBy', User::class, 'id', ['alias' => 'RestoredByEntity']);
864
    }
865
    
866
    /**
867
     * Adds the default validations to the model.
868
     * @param Validation|null $validator
869
     * @return Validation
870
     */
871
    public function addDefaultValidations(?Validation $validator = null): Validation
872
    {
873
        $validator ??= new Validation();
874
    
875
        $this->addUnsignedIntValidation($validator, 'id', true);
876
        $this->addStringLengthValidation($validator, 'label', 0, 255, false);
877
        $this->addStringLengthValidation($validator, 'code', 0, 10, false);
878
        $this->addUnsignedIntValidation($validator, 'deleted', false);
879
        $this->addDateTimeValidation($validator, 'createdAt', false);
880
        $this->addUnsignedIntValidation($validator, 'createdBy', true);
881
        $this->addUnsignedIntValidation($validator, 'createdAs', true);
882
        $this->addDateTimeValidation($validator, 'updatedAt', true);
883
        $this->addUnsignedIntValidation($validator, 'updatedBy', true);
884
        $this->addUnsignedIntValidation($validator, 'updatedAs', true);
885
        $this->addDateTimeValidation($validator, 'deletedAt', true);
886
        $this->addUnsignedIntValidation($validator, 'deletedAs', true);
887
        $this->addUnsignedIntValidation($validator, 'deletedBy', true);
888
        $this->addDateTimeValidation($validator, 'restoredAt', true);
889
        $this->addUnsignedIntValidation($validator, 'restoredBy', true);
890
        
891
        return $validator;
892
    }
893
894
        
895
    /**
896
     * Returns an array that maps the column names of the database
897
     * table to the corresponding property names of the model.
898
     * 
899
     * @returns array The array mapping the column names to the property names
900
     */
901
    public function columnMap(): array
902
    {
903
        return [
904
            'id' => 'id',
905
            'label' => 'label',
906
            'code' => 'code',
907
            'deleted' => 'deleted',
908
            'created_at' => 'createdAt',
909
            'created_by' => 'createdBy',
910
            'created_as' => 'createdAs',
911
            'updated_at' => 'updatedAt',
912
            'updated_by' => 'updatedBy',
913
            'updated_as' => 'updatedAs',
914
            'deleted_at' => 'deletedAt',
915
            'deleted_as' => 'deletedAs',
916
            'deleted_by' => 'deletedBy',
917
            'restored_at' => 'restoredAt',
918
            'restored_by' => 'restoredBy',
919
        ];
920
    }
921
}
922