1: <?php
2: /**
3: * This code is licensed under AGPLv3 license or Afterlogic Software License
4: * if commercial version of the product was purchased.
5: * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files.
6: */
7:
8: namespace Aurora\Modules\CpanelIntegrator\Models;
9:
10: use Aurora\System\Classes\Model;
11: use Aurora\Modules\Mail\Models\MailAccount;
12:
13: /**
14: * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0
15: * @license https://afterlogic.com/products/common-licensing Afterlogic Software License
16: * @copyright Copyright (c) 2023, Afterlogic Corp.
17: *
18: * @property int $IdUser
19: */
20: class Alias extends Model
21: {
22: protected $table = 'cpanel_aliases';
23:
24: protected $foreignModel = MailAccount::class;
25: protected $foreignModelIdColumn = 'IdAccount'; // Column that refers to an external table
26:
27: protected $fillable = [
28: 'Id',
29: 'IdUser',
30: 'IdAccount',
31: 'Email',
32: 'ForwardTo',
33: 'FriendlyName',
34: 'UseSignature',
35: 'Signature'
36: ];
37:
38: protected $appends = [
39: 'EntityId'
40: ];
41:
42: public function getEntityIdAttribute()
43: {
44: return $this->Id;
45: }
46:
47: public function __construct(array $attributes = [])
48: {
49: parent::__construct($attributes);
50: $this->Signature = '';
51: }
52: }
53: