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

EcmDirectory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A user() 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\Ecm\Model;
20
21
use Carbon\Carbon;
22
use Dolibarr\Code\UserGroup\Model\User;
23
use Dolibarr\Core\Base\Model;
24
25
/**
26
 * Class EcmDirectory
27
 *
28
 * @property int $rowid
29
 * @property string $label
30
 * @property int $entity
31
 * @property int|null $fk_parent
32
 * @property string $description
33
 * @property int $cachenbofdoc
34
 * @property string|null $fullpath
35
 * @property string|null $extraparams
36
 * @property Carbon|null $date_c
37
 * @property Carbon|null $tms
38
 * @property int|null $fk_user_c
39
 * @property int|null $fk_user_m
40
 * @property string|null $note_private
41
 * @property string|null $note_public
42
 * @property string|null $acl
43
 *
44
 * @property User|null $user
45
 */
46
class EcmDirectory extends Model
47
{
48
    public $timestamps = false;
49
    protected $table = 'ecm_directories';
50
    protected $casts = [
51
        'entity' => 'int',
52
        'fk_parent' => 'int',
53
        'cachenbofdoc' => 'int',
54
        'date_c' => 'datetime',
55
        'tms' => 'datetime',
56
        'fk_user_c' => 'int',
57
        'fk_user_m' => 'int'
58
    ];
59
60
    protected $fillable = [
61
        'label',
62
        'entity',
63
        'fk_parent',
64
        'description',
65
        'cachenbofdoc',
66
        'fullpath',
67
        'extraparams',
68
        'date_c',
69
        'tms',
70
        'fk_user_c',
71
        'fk_user_m',
72
        'note_private',
73
        'note_public',
74
        'acl'
75
    ];
76
77
    public function user()
78
    {
79
        return $this->belongsTo(User::class, 'fk_user_m');
80
    }
81
}
82