|
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\EmailCollector\Model; |
|
20
|
|
|
|
|
21
|
|
|
use Carbon\Carbon; |
|
22
|
|
|
use Dolibarr\Core\Base\Model; |
|
23
|
|
|
use Illuminate\Database\Eloquent\Collection; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Class EmailcollectorEmailcollector |
|
27
|
|
|
* |
|
28
|
|
|
* @property int $rowid |
|
29
|
|
|
* @property int $entity |
|
30
|
|
|
* @property string $ref |
|
31
|
|
|
* @property string|null $label |
|
32
|
|
|
* @property string|null $description |
|
33
|
|
|
* @property string|null $host |
|
34
|
|
|
* @property string|null $port |
|
35
|
|
|
* @property string|null $hostcharset |
|
36
|
|
|
* @property string|null $imap_encryption |
|
37
|
|
|
* @property int|null $norsh |
|
38
|
|
|
* @property string|null $login |
|
39
|
|
|
* @property int|null $acces_type |
|
40
|
|
|
* @property string|null $oauth_service |
|
41
|
|
|
* @property string|null $password |
|
42
|
|
|
* @property string $source_directory |
|
43
|
|
|
* @property string|null $target_directory |
|
44
|
|
|
* @property int|null $maxemailpercollect |
|
45
|
|
|
* @property Carbon|null $datelastresult |
|
46
|
|
|
* @property string|null $codelastresult |
|
47
|
|
|
* @property string|null $lastresult |
|
48
|
|
|
* @property Carbon|null $datelastok |
|
49
|
|
|
* @property string|null $note_public |
|
50
|
|
|
* @property string|null $note_private |
|
51
|
|
|
* @property Carbon $date_creation |
|
52
|
|
|
* @property Carbon|null $tms |
|
53
|
|
|
* @property int $fk_user_creat |
|
54
|
|
|
* @property int|null $fk_user_modif |
|
55
|
|
|
* @property int $position |
|
56
|
|
|
* @property string|null $import_key |
|
57
|
|
|
* @property int $status |
|
58
|
|
|
* |
|
59
|
|
|
* @property Collection|EmailcollectorEmailcollectoraction[] $emailcollector_emailcollectoractions |
|
60
|
|
|
* @property Collection|EmailcollectorEmailcollectorfilter[] $emailcollector_emailcollectorfilters |
|
61
|
|
|
*/ |
|
62
|
|
|
class EmailcollectorEmailcollector extends Model |
|
63
|
|
|
{ |
|
64
|
|
|
public $timestamps = false; |
|
65
|
|
|
protected $table = 'emailcollector_emailcollector'; |
|
66
|
|
|
protected $casts = [ |
|
67
|
|
|
'entity' => 'int', |
|
68
|
|
|
'norsh' => 'int', |
|
69
|
|
|
'acces_type' => 'int', |
|
70
|
|
|
'maxemailpercollect' => 'int', |
|
71
|
|
|
'datelastresult' => 'datetime', |
|
72
|
|
|
'datelastok' => 'datetime', |
|
73
|
|
|
'date_creation' => 'datetime', |
|
74
|
|
|
'tms' => 'datetime', |
|
75
|
|
|
'fk_user_creat' => 'int', |
|
76
|
|
|
'fk_user_modif' => 'int', |
|
77
|
|
|
'position' => 'int', |
|
78
|
|
|
'status' => 'int' |
|
79
|
|
|
]; |
|
80
|
|
|
|
|
81
|
|
|
protected $hidden = [ |
|
82
|
|
|
'password' |
|
83
|
|
|
]; |
|
84
|
|
|
|
|
85
|
|
|
protected $fillable = [ |
|
86
|
|
|
'entity', |
|
87
|
|
|
'ref', |
|
88
|
|
|
'label', |
|
89
|
|
|
'description', |
|
90
|
|
|
'host', |
|
91
|
|
|
'port', |
|
92
|
|
|
'hostcharset', |
|
93
|
|
|
'imap_encryption', |
|
94
|
|
|
'norsh', |
|
95
|
|
|
'login', |
|
96
|
|
|
'acces_type', |
|
97
|
|
|
'oauth_service', |
|
98
|
|
|
'password', |
|
99
|
|
|
'source_directory', |
|
100
|
|
|
'target_directory', |
|
101
|
|
|
'maxemailpercollect', |
|
102
|
|
|
'datelastresult', |
|
103
|
|
|
'codelastresult', |
|
104
|
|
|
'lastresult', |
|
105
|
|
|
'datelastok', |
|
106
|
|
|
'note_public', |
|
107
|
|
|
'note_private', |
|
108
|
|
|
'date_creation', |
|
109
|
|
|
'tms', |
|
110
|
|
|
'fk_user_creat', |
|
111
|
|
|
'fk_user_modif', |
|
112
|
|
|
'position', |
|
113
|
|
|
'import_key', |
|
114
|
|
|
'status' |
|
115
|
|
|
]; |
|
116
|
|
|
|
|
117
|
|
|
public function emailcollector_emailcollectoractions() |
|
118
|
|
|
{ |
|
119
|
|
|
return $this->hasMany(EmailcollectorEmailcollectoraction::class, 'fk_emailcollector'); |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
public function emailcollector_emailcollectorfilters() |
|
123
|
|
|
{ |
|
124
|
|
|
return $this->hasMany(EmailcollectorEmailcollectorfilter::class, 'fk_emailcollector'); |
|
125
|
|
|
} |
|
126
|
|
|
} |
|
127
|
|
|
|