Passed
Push — MODEL_LIB_240928 ( 74ce72...807d7f )
by Rafael
49:53
created

BomBomline   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A bom_bom() 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\Bom\Model;
20
21
use Carbon\Carbon;
22
use Dolibarr\Core\Base\Model;
23
24
/**
25
 * Class BomBomline
26
 *
27
 * @property int $rowid
28
 * @property int $fk_bom
29
 * @property int $fk_product
30
 * @property int|null $fk_bom_child
31
 * @property Carbon|null $tms
32
 * @property string|null $description
33
 * @property string|null $import_key
34
 * @property float $qty
35
 * @property int|null $qty_frozen
36
 * @property int|null $disable_stock_change
37
 * @property float $efficiency
38
 * @property int|null $fk_unit
39
 * @property int $position
40
 * @property int|null $fk_default_workstation
41
 *
42
 * @property BomBom $bom_bom
43
 */
44
class BomBomline extends Model
45
{
46
    public $timestamps = false;
47
    protected $table = 'bom_bomline';
48
    protected $casts = [
49
        'fk_bom' => 'int',
50
        'fk_product' => 'int',
51
        'fk_bom_child' => 'int',
52
        'tms' => 'datetime',
53
        'qty' => 'float',
54
        'qty_frozen' => 'int',
55
        'disable_stock_change' => 'int',
56
        'efficiency' => 'float',
57
        'fk_unit' => 'int',
58
        'position' => 'int',
59
        'fk_default_workstation' => 'int'
60
    ];
61
62
    protected $fillable = [
63
        'fk_bom',
64
        'fk_product',
65
        'fk_bom_child',
66
        'tms',
67
        'description',
68
        'import_key',
69
        'qty',
70
        'qty_frozen',
71
        'disable_stock_change',
72
        'efficiency',
73
        'fk_unit',
74
        'position',
75
        'fk_default_workstation'
76
    ];
77
78
    public function bom_bom()
79
    {
80
        return $this->belongsTo(BomBom::class, 'fk_bom');
81
    }
82
}
83