Passed
Push — MODEL_LIB_240928 ( 143dd3...d1103d )
by Rafael
57:04 queued 21s
created

CategorieFournisseur   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A societe() 0 3 1
A categorie() 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\Fourn\Model;
20
21
use Dolibarr\Code\Categories\Model\Categorie;
22
use Dolibarr\Code\Societe\Model\Societe;
23
use Dolibarr\Core\Base\Model;
24
25
/**
26
 * Class CategorieFournisseur
27
 *
28
 * @property int $fk_categorie
29
 * @property int $fk_soc
30
 * @property string|null $import_key
31
 *
32
 * @property Categorie $categorie
33
 * @property Societe $societe
34
 */
35
class CategorieFournisseur extends Model
36
{
37
    public $incrementing = false;
38
    public $timestamps = false;
39
    protected $table = 'categorie_fournisseur';
40
    protected $casts = [
41
        'fk_categorie' => 'int',
42
        'fk_soc' => 'int'
43
    ];
44
45
    protected $fillable = [
46
        'import_key'
47
    ];
48
49
    public function categorie()
50
    {
51
        return $this->belongsTo(Categorie::class, 'fk_categorie');
52
    }
53
54
    public function societe()
55
    {
56
        return $this->belongsTo(Societe::class, 'fk_soc');
57
    }
58
}
59