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

Box::boxes_def()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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\Boxes\Model;
20
21
use Dolibarr\Core\Base\Model;
22
23
/**
24
 * Class Box
25
 *
26
 * @property int $rowid
27
 * @property int $entity
28
 * @property int $box_id
29
 * @property int $position
30
 * @property string $box_order
31
 * @property int $fk_user
32
 * @property int|null $maxline
33
 * @property string|null $params
34
 *
35
 * @property BoxesDef $boxes_def
36
 */
37
class Box extends Model
38
{
39
    public $timestamps = false;
40
    protected $table = 'boxes';
41
    protected $casts = [
42
        'entity' => 'int',
43
        'box_id' => 'int',
44
        'position' => 'int',
45
        'fk_user' => 'int',
46
        'maxline' => 'int'
47
    ];
48
49
    protected $fillable = [
50
        'entity',
51
        'box_id',
52
        'position',
53
        'box_order',
54
        'fk_user',
55
        'maxline',
56
        'params'
57
    ];
58
59
    public function boxes_def()
60
    {
61
        return $this->belongsTo(BoxesDef::class, 'box_id');
62
    }
63
}
64