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