|
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\Categories\Model; |
|
20
|
|
|
|
|
21
|
|
|
use Dolibarr\Code\Website\Model\WebsitePage; |
|
22
|
|
|
use Dolibarr\Core\Base\Model; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Class CategorieWebsitePage |
|
26
|
|
|
* |
|
27
|
|
|
* @property int $fk_categorie |
|
28
|
|
|
* @property int $fk_website_page |
|
29
|
|
|
* @property string|null $import_key |
|
30
|
|
|
* |
|
31
|
|
|
* @property Categorie $categorie |
|
32
|
|
|
* @property WebsitePage $website_page |
|
33
|
|
|
*/ |
|
34
|
|
|
class CategorieWebsitePage extends Model |
|
35
|
|
|
{ |
|
36
|
|
|
public $incrementing = false; |
|
37
|
|
|
public $timestamps = false; |
|
38
|
|
|
protected $table = 'categorie_website_page'; |
|
39
|
|
|
protected $casts = [ |
|
40
|
|
|
'fk_categorie' => 'int', |
|
41
|
|
|
'fk_website_page' => '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 website_page() |
|
54
|
|
|
{ |
|
55
|
|
|
return $this->belongsTo(WebsitePage::class, 'fk_website_page'); |
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
|