Test Failed
Push — master ( 35ab15...7ed30e )
by Julien
04:21
created

AbstractEmail::columnMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 30

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 30
nc 1
nop 0
dl 0
loc 32
ccs 0
cts 31
cp 0
crap 2
rs 9.44
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the Zemit Framework.
5
 *
6
 * (c) Zemit Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 *
11
 * --------------------------------------------------------------
12
 *
13
 * New BSD License
14
 *
15
 * Copyright (c) 2017-present, Zemit CMS Team
16
 * All rights reserved.
17
 *
18
 * Redistribution and use in source and binary forms, with or without
19
 * modification, are permitted provided that the following conditions are met:
20
 *     * Redistributions of source code must retain the above copyright
21
 *       notice, this list of conditions and the following disclaimer.
22
 *     * Redistributions in binary form must reproduce the above copyright
23
 *       notice, this list of conditions and the following disclaimer in the
24
 *       documentation and/or other materials provided with the distribution.
25
 *     * Neither the name of the Zemit nor the
26
 *       names of its contributors may be used to endorse or promote products
27
 *       derived from this software without specific prior written permission.
28
 *
29
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32
 * DISCLAIMED. IN NO EVENT SHALL ZEMIT FRAMEWORK TEAM BE LIABLE FOR ANY
33
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
 */
40
41
namespace Zemit\Models\Abstracts;
42
43
use Phalcon\Mvc\ModelInterface;
44
use Phalcon\Mvc\Model\ResultInterface;
45
use Phalcon\Mvc\Model\ResultsetInterface;
46
use Zemit\Models\AbstractModel;
47
48
/**
49
 * AbstractEmail
50
 * @package Zemit\Models\Base
51
 * @autogenerated by Phalcon Developer Tools
52
 * @date 2023-03-30, 04:45:31
53
 */
54
abstract class AbstractEmail extends AbstractModel
55
{
56
    /**
57
     * @var integer
58
     * @Primary
59
     * @Identity
60
     * @Column(column="id", type="integer", nullable=false)
61
     */
62
    protected $id;
63
64
    /**
65
     * @var integer
66
     * @Column(column="template_id", type="integer", nullable=false)
67
     */
68
    protected $templateId;
69
70
    /**
71
     * @var string
72
     * @Column(column="uuid", type="string", length=255, nullable=false)
73
     */
74
    protected $uuid;
75
76
    /**
77
     * @var string
78
     * @Column(column="from", type="string", length=500, nullable=false)
79
     */
80
    protected $from;
81
82
    /**
83
     * @var string
84
     * @Column(column="to", type="string", nullable=false)
85
     */
86
    protected $to;
87
88
    /**
89
     * @var string
90
     * @Column(column="cc", type="string", nullable=true)
91
     */
92
    protected $cc;
93
94
    /**
95
     * @var string
96
     * @Column(column="bcc", type="string", nullable=true)
97
     */
98
    protected $bcc;
99
100
    /**
101
     * @var string
102
     * @Column(column="read_receipt_to", type="string", nullable=true)
103
     */
104
    protected $readReceiptTo;
105
106
    /**
107
     * @var string
108
     * @Column(column="subject", type="string", length=255, nullable=false)
109
     */
110
    protected $subject;
111
112
    /**
113
     * @var string
114
     * @Column(column="content", type="string", nullable=false)
115
     */
116
    protected $content;
117
118
    /**
119
     * @var string
120
     * @Column(column="meta", type="string", nullable=true)
121
     */
122
    protected $meta;
123
124
    /**
125
     * @var string
126
     * @Column(column="view_path", type="string", length=255, nullable=true)
127
     */
128
    protected $viewPath;
129
130
    /**
131
     * @var integer
132
     * @Column(column="sent", type="integer", nullable=false)
133
     */
134
    protected $sent;
135
136
    /**
137
     * @var string
138
     * @Column(column="sent_at", type="string", nullable=true)
139
     */
140
    protected $sentAt;
141
142
    /**
143
     * @var integer
144
     * @Column(column="sent_by", type="integer", nullable=true)
145
     */
146
    protected $sentBy;
147
148
    /**
149
     * @var integer
150
     * @Column(column="sent_as", type="integer", nullable=true)
151
     */
152
    protected $sentAs;
153
154
    /**
155
     * @var integer
156
     * @Column(column="deleted", type="integer", nullable=false)
157
     */
158
    protected $deleted;
159
160
    /**
161
     * @var string
162
     * @Column(column="created_at", type="string", nullable=false)
163
     */
164
    protected $createdAt;
165
166
    /**
167
     * @var integer
168
     * @Column(column="created_by", type="integer", nullable=true)
169
     */
170
    protected $createdBy;
171
172
    /**
173
     * @var integer
174
     * @Column(column="created_as", type="integer", nullable=true)
175
     */
176
    protected $createdAs;
177
178
    /**
179
     * @var string
180
     * @Column(column="updated_at", type="string", nullable=true)
181
     */
182
    protected $updatedAt;
183
184
    /**
185
     * @var integer
186
     * @Column(column="updated_by", type="integer", nullable=true)
187
     */
188
    protected $updatedBy;
189
190
    /**
191
     * @var integer
192
     * @Column(column="updated_as", type="integer", nullable=true)
193
     */
194
    protected $updatedAs;
195
196
    /**
197
     * @var string
198
     * @Column(column="deleted_at", type="string", nullable=true)
199
     */
200
    protected $deletedAt;
201
202
    /**
203
     * @var integer
204
     * @Column(column="deleted_by", type="integer", nullable=true)
205
     */
206
    protected $deletedBy;
207
208
    /**
209
     * @var integer
210
     * @Column(column="deleted_as", type="integer", nullable=true)
211
     */
212
    protected $deletedAs;
213
214
    /**
215
     * @var string
216
     * @Column(column="restored_at", type="string", nullable=true)
217
     */
218
    protected $restoredAt;
219
220
    /**
221
     * @var integer
222
     * @Column(column="restored_by", type="integer", nullable=true)
223
     */
224
    protected $restoredBy;
225
226
    /**
227
     * @var integer
228
     * @Column(column="restored_as", type="integer", nullable=true)
229
     */
230
    protected $restoredAs;
231
232
    /**
233
     * Method to set the value of field id
234
     *
235
     * @param integer $id
236
     * @return $this
237
     */
238
    public function setId($id)
239
    {
240
        $this->id = $id;
241
242
        return $this;
243
    }
244
245
    /**
246
     * Returns the value of field id
247
     *
248
     * @return integer
249
     */
250
    public function getId()
251
    {
252
        return $this->id;
253
    }
254
255
    /**
256
     * Method to set the value of field template_id
257
     *
258
     * @param integer $templateId
259
     * @return $this
260
     */
261
    public function setTemplateId($templateId)
262
    {
263
        $this->templateId = $templateId;
264
265
        return $this;
266
    }
267
268
    /**
269
     * Returns the value of field template_id
270
     *
271
     * @return integer
272
     */
273
    public function getTemplateId()
274
    {
275
        return $this->templateId;
276
    }
277
278
    /**
279
     * Method to set the value of field uuid
280
     *
281
     * @param string $uuid
282
     * @return $this
283
     */
284
    public function setUuid($uuid)
285
    {
286
        $this->uuid = $uuid;
287
288
        return $this;
289
    }
290
291
    /**
292
     * Returns the value of field uuid
293
     *
294
     * @return string
295
     */
296
    public function getUuid()
297
    {
298
        return $this->uuid;
299
    }
300
301
    /**
302
     * Method to set the value of field from
303
     *
304
     * @param string $from
305
     * @return $this
306
     */
307
    public function setFrom($from)
308
    {
309
        $this->from = $from;
310
311
        return $this;
312
    }
313
314
    /**
315
     * Returns the value of field from
316
     *
317
     * @return string
318
     */
319
    public function getFrom()
320
    {
321
        return $this->from;
322
    }
323
324
    /**
325
     * Method to set the value of field to
326
     *
327
     * @param string $to
328
     * @return $this
329
     */
330
    public function setTo($to)
331
    {
332
        $this->to = $to;
333
334
        return $this;
335
    }
336
337
    /**
338
     * Returns the value of field to
339
     *
340
     * @return string
341
     */
342
    public function getTo()
343
    {
344
        return $this->to;
345
    }
346
347
    /**
348
     * Method to set the value of field cc
349
     *
350
     * @param string $cc
351
     * @return $this
352
     */
353
    public function setCc($cc)
354
    {
355
        $this->cc = $cc;
356
357
        return $this;
358
    }
359
360
    /**
361
     * Returns the value of field cc
362
     *
363
     * @return string
364
     */
365
    public function getCc()
366
    {
367
        return $this->cc;
368
    }
369
370
    /**
371
     * Method to set the value of field bcc
372
     *
373
     * @param string $bcc
374
     * @return $this
375
     */
376
    public function setBcc($bcc)
377
    {
378
        $this->bcc = $bcc;
379
380
        return $this;
381
    }
382
383
    /**
384
     * Returns the value of field bcc
385
     *
386
     * @return string
387
     */
388
    public function getBcc()
389
    {
390
        return $this->bcc;
391
    }
392
393
    /**
394
     * Method to set the value of field read_receipt_to
395
     *
396
     * @param string $readReceiptTo
397
     * @return $this
398
     */
399
    public function setReadReceiptTo($readReceiptTo)
400
    {
401
        $this->readReceiptTo = $readReceiptTo;
402
403
        return $this;
404
    }
405
406
    /**
407
     * Returns the value of field read_receipt_to
408
     *
409
     * @return string
410
     */
411
    public function getReadReceiptTo()
412
    {
413
        return $this->readReceiptTo;
414
    }
415
416
    /**
417
     * Method to set the value of field subject
418
     *
419
     * @param string $subject
420
     * @return $this
421
     */
422
    public function setSubject($subject)
423
    {
424
        $this->subject = $subject;
425
426
        return $this;
427
    }
428
429
    /**
430
     * Returns the value of field subject
431
     *
432
     * @return string
433
     */
434
    public function getSubject()
435
    {
436
        return $this->subject;
437
    }
438
439
    /**
440
     * Method to set the value of field content
441
     *
442
     * @param string $content
443
     * @return $this
444
     */
445
    public function setContent($content)
446
    {
447
        $this->content = $content;
448
449
        return $this;
450
    }
451
452
    /**
453
     * Returns the value of field content
454
     *
455
     * @return string
456
     */
457
    public function getContent()
458
    {
459
        return $this->content;
460
    }
461
462
    /**
463
     * Method to set the value of field meta
464
     *
465
     * @param string $meta
466
     * @return $this
467
     */
468
    public function setMeta($meta)
469
    {
470
        $this->meta = $meta;
471
472
        return $this;
473
    }
474
475
    /**
476
     * Returns the value of field meta
477
     *
478
     * @return string
479
     */
480
    public function getMeta()
481
    {
482
        return $this->meta;
483
    }
484
485
    /**
486
     * Method to set the value of field view_path
487
     *
488
     * @param string $viewPath
489
     * @return $this
490
     */
491
    public function setViewPath($viewPath)
492
    {
493
        $this->viewPath = $viewPath;
494
495
        return $this;
496
    }
497
498
    /**
499
     * Returns the value of field view_path
500
     *
501
     * @return string
502
     */
503
    public function getViewPath()
504
    {
505
        return $this->viewPath;
506
    }
507
508
    /**
509
     * Method to set the value of field sent
510
     *
511
     * @param integer $sent
512
     * @return $this
513
     */
514
    public function setSent($sent)
515
    {
516
        $this->sent = $sent;
517
518
        return $this;
519
    }
520
521
    /**
522
     * Returns the value of field sent
523
     *
524
     * @return integer
525
     */
526
    public function getSent()
527
    {
528
        return $this->sent;
529
    }
530
531
    /**
532
     * Method to set the value of field sent_at
533
     *
534
     * @param string $sentAt
535
     * @return $this
536
     */
537
    public function setSentAt($sentAt)
538
    {
539
        $this->sentAt = $sentAt;
540
541
        return $this;
542
    }
543
544
    /**
545
     * Returns the value of field sent_at
546
     *
547
     * @return string
548
     */
549
    public function getSentAt()
550
    {
551
        return $this->sentAt;
552
    }
553
554
    /**
555
     * Method to set the value of field sent_by
556
     *
557
     * @param integer $sentBy
558
     * @return $this
559
     */
560
    public function setSentBy($sentBy)
561
    {
562
        $this->sentBy = $sentBy;
563
564
        return $this;
565
    }
566
567
    /**
568
     * Returns the value of field sent_by
569
     *
570
     * @return integer
571
     */
572
    public function getSentBy()
573
    {
574
        return $this->sentBy;
575
    }
576
577
    /**
578
     * Method to set the value of field sent_as
579
     *
580
     * @param integer $sentAs
581
     * @return $this
582
     */
583
    public function setSentAs($sentAs)
584
    {
585
        $this->sentAs = $sentAs;
586
587
        return $this;
588
    }
589
590
    /**
591
     * Returns the value of field sent_as
592
     *
593
     * @return integer
594
     */
595
    public function getSentAs()
596
    {
597
        return $this->sentAs;
598
    }
599
600
    /**
601
     * Method to set the value of field deleted
602
     *
603
     * @param integer $deleted
604
     * @return $this
605
     */
606
    public function setDeleted($deleted)
607
    {
608
        $this->deleted = $deleted;
609
610
        return $this;
611
    }
612
613
    /**
614
     * Returns the value of field deleted
615
     *
616
     * @return integer
617
     */
618
    public function getDeleted()
619
    {
620
        return $this->deleted;
621
    }
622
623
    /**
624
     * Method to set the value of field created_at
625
     *
626
     * @param string $createdAt
627
     * @return $this
628
     */
629
    public function setCreatedAt($createdAt)
630
    {
631
        $this->createdAt = $createdAt;
632
633
        return $this;
634
    }
635
636
    /**
637
     * Returns the value of field created_at
638
     *
639
     * @return string
640
     */
641
    public function getCreatedAt()
642
    {
643
        return $this->createdAt;
644
    }
645
646
    /**
647
     * Method to set the value of field created_by
648
     *
649
     * @param integer $createdBy
650
     * @return $this
651
     */
652
    public function setCreatedBy($createdBy)
653
    {
654
        $this->createdBy = $createdBy;
655
656
        return $this;
657
    }
658
659
    /**
660
     * Returns the value of field created_by
661
     *
662
     * @return integer
663
     */
664
    public function getCreatedBy()
665
    {
666
        return $this->createdBy;
667
    }
668
669
    /**
670
     * Method to set the value of field created_as
671
     *
672
     * @param integer $createdAs
673
     * @return $this
674
     */
675
    public function setCreatedAs($createdAs)
676
    {
677
        $this->createdAs = $createdAs;
678
679
        return $this;
680
    }
681
682
    /**
683
     * Returns the value of field created_as
684
     *
685
     * @return integer
686
     */
687
    public function getCreatedAs()
688
    {
689
        return $this->createdAs;
690
    }
691
692
    /**
693
     * Method to set the value of field updated_at
694
     *
695
     * @param string $updatedAt
696
     * @return $this
697
     */
698
    public function setUpdatedAt($updatedAt)
699
    {
700
        $this->updatedAt = $updatedAt;
701
702
        return $this;
703
    }
704
705
    /**
706
     * Returns the value of field updated_at
707
     *
708
     * @return string
709
     */
710
    public function getUpdatedAt()
711
    {
712
        return $this->updatedAt;
713
    }
714
715
    /**
716
     * Method to set the value of field updated_by
717
     *
718
     * @param integer $updatedBy
719
     * @return $this
720
     */
721
    public function setUpdatedBy($updatedBy)
722
    {
723
        $this->updatedBy = $updatedBy;
724
725
        return $this;
726
    }
727
728
    /**
729
     * Returns the value of field updated_by
730
     *
731
     * @return integer
732
     */
733
    public function getUpdatedBy()
734
    {
735
        return $this->updatedBy;
736
    }
737
738
    /**
739
     * Method to set the value of field updated_as
740
     *
741
     * @param integer $updatedAs
742
     * @return $this
743
     */
744
    public function setUpdatedAs($updatedAs)
745
    {
746
        $this->updatedAs = $updatedAs;
747
748
        return $this;
749
    }
750
751
    /**
752
     * Returns the value of field updated_as
753
     *
754
     * @return integer
755
     */
756
    public function getUpdatedAs()
757
    {
758
        return $this->updatedAs;
759
    }
760
761
    /**
762
     * Method to set the value of field deleted_at
763
     *
764
     * @param string $deletedAt
765
     * @return $this
766
     */
767
    public function setDeletedAt($deletedAt)
768
    {
769
        $this->deletedAt = $deletedAt;
770
771
        return $this;
772
    }
773
774
    /**
775
     * Returns the value of field deleted_at
776
     *
777
     * @return string
778
     */
779
    public function getDeletedAt()
780
    {
781
        return $this->deletedAt;
782
    }
783
784
    /**
785
     * Method to set the value of field deleted_by
786
     *
787
     * @param integer $deletedBy
788
     * @return $this
789
     */
790
    public function setDeletedBy($deletedBy)
791
    {
792
        $this->deletedBy = $deletedBy;
793
794
        return $this;
795
    }
796
797
    /**
798
     * Returns the value of field deleted_by
799
     *
800
     * @return integer
801
     */
802
    public function getDeletedBy()
803
    {
804
        return $this->deletedBy;
805
    }
806
807
    /**
808
     * Method to set the value of field deleted_as
809
     *
810
     * @param integer $deletedAs
811
     * @return $this
812
     */
813
    public function setDeletedAs($deletedAs)
814
    {
815
        $this->deletedAs = $deletedAs;
816
817
        return $this;
818
    }
819
820
    /**
821
     * Returns the value of field deleted_as
822
     *
823
     * @return integer
824
     */
825
    public function getDeletedAs()
826
    {
827
        return $this->deletedAs;
828
    }
829
830
    /**
831
     * Method to set the value of field restored_at
832
     *
833
     * @param string $restoredAt
834
     * @return $this
835
     */
836
    public function setRestoredAt($restoredAt)
837
    {
838
        $this->restoredAt = $restoredAt;
839
840
        return $this;
841
    }
842
843
    /**
844
     * Returns the value of field restored_at
845
     *
846
     * @return string
847
     */
848
    public function getRestoredAt()
849
    {
850
        return $this->restoredAt;
851
    }
852
853
    /**
854
     * Method to set the value of field restored_by
855
     *
856
     * @param integer $restoredBy
857
     * @return $this
858
     */
859
    public function setRestoredBy($restoredBy)
860
    {
861
        $this->restoredBy = $restoredBy;
862
863
        return $this;
864
    }
865
866
    /**
867
     * Returns the value of field restored_by
868
     *
869
     * @return integer
870
     */
871
    public function getRestoredBy()
872
    {
873
        return $this->restoredBy;
874
    }
875
876
    /**
877
     * Method to set the value of field restored_as
878
     *
879
     * @param integer $restoredAs
880
     * @return $this
881
     */
882
    public function setRestoredAs($restoredAs)
883
    {
884
        $this->restoredAs = $restoredAs;
885
886
        return $this;
887
    }
888
889
    /**
890
     * Returns the value of field restored_as
891
     *
892
     * @return integer
893
     */
894
    public function getRestoredAs()
895
    {
896
        return $this->restoredAs;
897
    }
898
899
    /**
900
     * Initialize method for model.
901
     */
902
    public function initialize(): void
903
    {
904
		parent::initialize();
905
        // $this->setSchema('zemit_core');
906
        $this->setSource('email');
907
    }
908
909
    /**
910
     * Allows to query a set of records that match the specified conditions
911
     *
912
     * @param mixed $parameters
913
     * @return AbstractEmail[]|AbstractEmail|ResultsetInterface
914
     */
915
    public static function find($parameters = null): ResultsetInterface
916
    {
917
        return parent::find($parameters);
918
    }
919
920
    /**
921
     * Allows to query the first record that match the specified conditions
922
     *
923
     * @param mixed $parameters
924
     * @return AbstractEmail|ResultInterface|ModelInterface|null
925
     */
926
    public static function findFirst($parameters = null): ?ModelInterface
927
    {
928
        return parent::findFirst($parameters);
929
    }
930
931
    /**
932
     * Independent Column Mapping.
933
     * Keys are the real names in the table and the values their names in the application
934
     *
935
     * @return array
936
     */
937
    public function columnMap()
938
    {
939
        return [
940
            'id' => 'id',
941
            'template_id' => 'templateId',
942
            'uuid' => 'uuid',
943
            'from' => 'from',
944
            'to' => 'to',
945
            'cc' => 'cc',
946
            'bcc' => 'bcc',
947
            'read_receipt_to' => 'readReceiptTo',
948
            'subject' => 'subject',
949
            'content' => 'content',
950
            'meta' => 'meta',
951
            'view_path' => 'viewPath',
952
            'sent' => 'sent',
953
            'sent_at' => 'sentAt',
954
            'sent_by' => 'sentBy',
955
            'sent_as' => 'sentAs',
956
            'deleted' => 'deleted',
957
            'created_at' => 'createdAt',
958
            'created_by' => 'createdBy',
959
            'created_as' => 'createdAs',
960
            'updated_at' => 'updatedAt',
961
            'updated_by' => 'updatedBy',
962
            'updated_as' => 'updatedAs',
963
            'deleted_at' => 'deletedAt',
964
            'deleted_by' => 'deletedBy',
965
            'deleted_as' => 'deletedAs',
966
            'restored_at' => 'restoredAt',
967
            'restored_by' => 'restoredBy',
968
            'restored_as' => 'restoredAs',
969
        ];
970
    }
971
}
972