|
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\FichInter\Model; |
|
20
|
|
|
|
|
21
|
|
|
use Carbon\Carbon; |
|
22
|
|
|
use Dolibarr\Code\Projet\Model\Projet; |
|
23
|
|
|
use Dolibarr\Code\UserGroup\Model\User; |
|
24
|
|
|
use Dolibarr\Core\Base\Model; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* Class FichinterRec |
|
28
|
|
|
* |
|
29
|
|
|
* @property int $rowid |
|
30
|
|
|
* @property string $title |
|
31
|
|
|
* @property int $entity |
|
32
|
|
|
* @property int|null $fk_soc |
|
33
|
|
|
* @property Carbon|null $datec |
|
34
|
|
|
* @property int|null $fk_contrat |
|
35
|
|
|
* @property int|null $fk_user_author |
|
36
|
|
|
* @property int|null $fk_projet |
|
37
|
|
|
* @property float|null $duree |
|
38
|
|
|
* @property string|null $description |
|
39
|
|
|
* @property string|null $modelpdf |
|
40
|
|
|
* @property string|null $note_private |
|
41
|
|
|
* @property string|null $note_public |
|
42
|
|
|
* @property int|null $frequency |
|
43
|
|
|
* @property string|null $unit_frequency |
|
44
|
|
|
* @property Carbon|null $date_when |
|
45
|
|
|
* @property Carbon|null $date_last_gen |
|
46
|
|
|
* @property int|null $nb_gen_done |
|
47
|
|
|
* @property int|null $nb_gen_max |
|
48
|
|
|
* @property int|null $auto_validate |
|
49
|
|
|
* @property int|null $status |
|
50
|
|
|
* |
|
51
|
|
|
* @property Projet|null $projet |
|
52
|
|
|
* @property User|null $user |
|
53
|
|
|
*/ |
|
54
|
|
|
class FichinterRec extends Model |
|
55
|
|
|
{ |
|
56
|
|
|
public $timestamps = false; |
|
57
|
|
|
protected $table = 'fichinter_rec'; |
|
58
|
|
|
protected $casts = [ |
|
59
|
|
|
'entity' => 'int', |
|
60
|
|
|
'fk_soc' => 'int', |
|
61
|
|
|
'datec' => 'datetime', |
|
62
|
|
|
'fk_contrat' => 'int', |
|
63
|
|
|
'fk_user_author' => 'int', |
|
64
|
|
|
'fk_projet' => 'int', |
|
65
|
|
|
'duree' => 'float', |
|
66
|
|
|
'frequency' => 'int', |
|
67
|
|
|
'date_when' => 'datetime', |
|
68
|
|
|
'date_last_gen' => 'datetime', |
|
69
|
|
|
'nb_gen_done' => 'int', |
|
70
|
|
|
'nb_gen_max' => 'int', |
|
71
|
|
|
'auto_validate' => 'int', |
|
72
|
|
|
'status' => 'int' |
|
73
|
|
|
]; |
|
74
|
|
|
|
|
75
|
|
|
protected $fillable = [ |
|
76
|
|
|
'title', |
|
77
|
|
|
'entity', |
|
78
|
|
|
'fk_soc', |
|
79
|
|
|
'datec', |
|
80
|
|
|
'fk_contrat', |
|
81
|
|
|
'fk_user_author', |
|
82
|
|
|
'fk_projet', |
|
83
|
|
|
'duree', |
|
84
|
|
|
'description', |
|
85
|
|
|
'modelpdf', |
|
86
|
|
|
'note_private', |
|
87
|
|
|
'note_public', |
|
88
|
|
|
'frequency', |
|
89
|
|
|
'unit_frequency', |
|
90
|
|
|
'date_when', |
|
91
|
|
|
'date_last_gen', |
|
92
|
|
|
'nb_gen_done', |
|
93
|
|
|
'nb_gen_max', |
|
94
|
|
|
'auto_validate', |
|
95
|
|
|
'status' |
|
96
|
|
|
]; |
|
97
|
|
|
|
|
98
|
|
|
public function projet() |
|
99
|
|
|
{ |
|
100
|
|
|
return $this->belongsTo(Projet::class, 'fk_projet'); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function user() |
|
104
|
|
|
{ |
|
105
|
|
|
return $this->belongsTo(User::class, 'fk_user_author'); |
|
106
|
|
|
} |
|
107
|
|
|
} |
|
108
|
|
|
|