Passed
Push — MODEL_LIB_240928 ( bd3167...74ce72 )
by Rafael
55:11
created

AdherentType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 23
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A adherents() 0 3 1
1
<?php
2
3
/* Copyright (C) 2024       Rafael San José         <[email protected]>
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 3 of the License, or
8
 * any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
namespace Dolibarr\Code\Adherents\Model;
20
21
use Carbon\Carbon;
22
use Dolibarr\Core\Base\Model;
23
use Illuminate\Database\Eloquent\Collection;
24
25
/**
26
 * Class AdherentType
27
 *
28
 * @property int $rowid
29
 * @property int $entity
30
 * @property Carbon|null $tms
31
 * @property int $statut
32
 * @property string $libelle
33
 * @property string $morphy
34
 * @property string|null $duration
35
 * @property string $subscription
36
 * @property float|null $amount
37
 * @property int|null $caneditamount
38
 * @property string $vote
39
 * @property string|null $note
40
 * @property string|null $mail_valid
41
 *
42
 * @property Collection|Adherent[] $adherents
43
 */
44
class AdherentType extends Model
45
{
46
    public $timestamps = false;
47
    protected $table = 'adherent_type';
48
    protected $casts = [
49
        'entity' => 'int',
50
        'tms' => 'datetime',
51
        'statut' => 'int',
52
        'amount' => 'float',
53
        'caneditamount' => 'int'
54
    ];
55
56
    protected $fillable = [
57
        'entity',
58
        'tms',
59
        'statut',
60
        'libelle',
61
        'morphy',
62
        'duration',
63
        'subscription',
64
        'amount',
65
        'caneditamount',
66
        'vote',
67
        'note',
68
        'mail_valid'
69
    ];
70
71
    public function adherents()
72
    {
73
        return $this->hasMany(Adherent::class, 'fk_adherent_type');
74
    }
75
}
76