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

CategoryAbstract::addDefaultRelationships()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 115
Code Lines 84

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 84
c 3
b 0
f 0
nc 1
nop 0
dl 0
loc 115
ccs 0
cts 94
cp 0
crap 2
rs 8.349

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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